(define (update from to)
(do ((y 0 (+ y 1)))
((= y grid-size))
(do ((x 0 (+ x 1)))
((= x grid-size))
(let* ((t (grid-ref from x y))
(t* (cond
((= t empty) empty)
((= t cu)
(if (<= 1 (neighbors from x y) 2) ehead cu))
((= t ehead) etail)
((= t etail) cu))))
(grid-set! to x y t*)))))
https://community.spritely.institute (Code: OCAPN2023)