game-of-life: use row directly in next-step.
parent
b29a99d03f
commit
18a3bd0c4c
|
@ -56,15 +56,9 @@ IN: game-of-life
|
||||||
row { bit-array } declare [| cell i |
|
row { bit-array } declare [| cell i |
|
||||||
i neighbor-row nth-unsafe
|
i neighbor-row nth-unsafe
|
||||||
cell [
|
cell [
|
||||||
2 3 between? i j grid
|
2 3 between? i row set-nth-unsafe
|
||||||
{ array } declare nth-unsafe
|
|
||||||
{ bit-array } declare set-nth-unsafe
|
|
||||||
] [
|
] [
|
||||||
3 = [
|
3 = [ t i row set-nth-unsafe ] when
|
||||||
t i j grid
|
|
||||||
{ array } declare nth-unsafe
|
|
||||||
{ bit-array } declare set-nth-unsafe
|
|
||||||
] when
|
|
||||||
] if
|
] if
|
||||||
] each-index
|
] each-index
|
||||||
] each-index ;
|
] each-index ;
|
||||||
|
|
Loading…
Reference in New Issue