feat: add gen-update-list
This commit is contained in:
parent
6425e62a20
commit
96af464e22
1 changed files with 15 additions and 0 deletions
15
game.scm
15
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 (cdr string-list) (+ (string-length (car (last-pair (car string-list)))) offset) )))
|
||||||
(find-string-list-len-iter string-list 0))
|
(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
|
;; Main
|
||||||
(set! *template* template-task)
|
(set! *template* template-task)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue