about summary refs log tree commit diff stats
path: root/ts
diff options
context:
space:
mode:
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);