From 96af464e22527b97b6b971470bd036b6932bffc2 Mon Sep 17 00:00:00 2001 From: SouthFox Date: Sat, 2 Nov 2024 23:17:33 +0800 Subject: [PATCH] feat: add gen-update-list --- game.scm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/game.scm b/game.scm index cd34846..d0f62ba 100644 --- a/game.scm +++ b/game.scm @@ -198,6 +198,21 @@ (find-string-list-len-iter (cdr string-list) (+ (string-length (car (last-pair (car string-list)))) offset) ))) (find-string-list-len-iter string-list 0)) +(define (gen-update-list string-length x y len) + (define (up-iter string-length x y llen part) + (if (= 0 llen) + part + (up-iter string-length + x + (+ 1 y) + (- llen 1) + (append part + (list (list + (+ (* y string-length) x ) + (+ len (+ (* y string-length) x)) + )))))) + (up-iter (+ 1 string-length) x y len '())) + ;; Main (set! *template* template-task)