cell_count_neighbors   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/contrib/game-of-life.xtm

Implementation

(bind-func cell_count_neighbors
  (lambda (w x y)
    (+ (cell_value w (- x 1) (- y 1))
       (cell_value w (- x 1) y)
       (cell_value w (- x 1) (+ y 1))
       (cell_value w x (- y 1))
       (cell_value w x (+ y 1))
       (cell_value w (+ x 1) (- y 1))
       (cell_value w (+ x 1) y)
       (cell_value w (+ x 1) (+ y 1)))))


Back to Index

Similar Entries