about summary refs log tree commit diff stats
path: root/ts
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2024-06-07 21:25:23 -0400
committerelioat <elioat@tilde.institute>2024-06-07 21:25:23 -0400
commitf5c151b9379f10fbf6c13bf40d645fe6999f894f (patch)
tree509de44f75d2198a9a4b9e5b3901d39399d35f38 /ts
parent8c17222a7edf55896773335eea18c6f89e0ca923 (diff)
downloadtour-f5c151b9379f10fbf6c13bf40d645fe6999f894f.tar.gz
*
Diffstat (limited to 'ts')
-rw-r--r--ts/bun/index.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/ts/bun/index.ts b/ts/bun/index.ts
index 0a0f217..2b63565 100644
--- a/ts/bun/index.ts
+++ b/ts/bun/index.ts
@@ -26,7 +26,7 @@ export function step(grid: Grid): Grid {
     return grid.map((row, x) =>
         row.map((cell, y) => {
             const neighbors = countNeighbors(grid, x, y);
-            return neighbors === 3 || (neighbors === 2 && cell);
+            return neighbors === 3 || (neighbors === 2 && cell) ? 1 : 0;
         })
     );
 }
@@ -67,6 +67,11 @@ const toad: Grid = [
     [0, 0, 0, 0, 0, 0]
 ];
 
+console.log('Initial:');
 simulate(initial, 5);
+
+console.log('Flyer:');
 simulate(flyer, 5);
+
+console.log('Toad:');
 simulate(toad, 5);