about summary refs log tree commit diff stats
path: root/ts
diff options
context:
space:
mode:
authorelioat <{ID}+{username}@users.noreply.github.com>2024-06-21 08:18:00 -0400
committerelioat <{ID}+{username}@users.noreply.github.com>2024-06-21 08:18:00 -0400
commit44c8c917f84a44eeb70aa6e2b598d9af52b6d765 (patch)
treebde254473a04bcc096053d430839be6a49e96cc4 /ts
parent491c79ec99ebfeb2775851bb2c402343e09f3af3 (diff)
downloadtour-44c8c917f84a44eeb70aa6e2b598d9af52b6d765.tar.gz
*
Diffstat (limited to 'ts')
-rw-r--r--ts/bun/life.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/ts/bun/life.ts b/ts/bun/life.ts
index 965e422..bd36c27 100644
--- a/ts/bun/life.ts
+++ b/ts/bun/life.ts
@@ -1,9 +1,6 @@
 export type Grid = number[][];
 
-export function printGrid(grid: Grid): void {
-    grid.forEach(row => console.log(row.map(cell => cell ? '🟢' : '⚪️').join('')));
-    console.log('\n');
-}
+// FIXME: I'm exporting way more than is necessary to support testing. What if I didn't do that?
 
 export function countNeighbors(grid: Grid, x: number, y: number): number {
     const neighborOffsets = [
@@ -31,6 +28,11 @@ export function step(grid: Grid): Grid {
     );
 }
 
+export function printGrid(grid: Grid): void {
+    grid.forEach(row => console.log(row.map(cell => cell ? '🟢' : '⚪️').join('')));
+    console.log('\n');
+}
+
 export function simulate(initial: Grid, steps: number): void {
     let grid = initial;
     Array.from({ length: steps }).forEach(() => {