From d44076b32c165aa9071dd561504b6d2e5c113b1c Mon Sep 17 00:00:00 2001 From: Tangent Wantwight Date: Sat, 13 Jan 2024 14:46:04 -0500 Subject: [PATCH] keep stats --- island.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/island.ts b/island.ts index 740b5e3..8e3fd15 100644 --- a/island.ts +++ b/island.ts @@ -12,6 +12,7 @@ export function IslandApplet() { // STATE let timerId: number; + let ticks = 0; let islands = new IslandGrid(WIDTH, HEIGHT, DEFAULT_SEED); // UI @@ -30,12 +31,15 @@ export function IslandApplet() { onclick: () => { clearInterval(timerId); + ticks = 0; islands = new IslandGrid(WIDTH, HEIGHT, seedInput.valueAsNumber); timerId = setInterval(function tick() { islands.step(); islands.step(); islands.step(); + + ticks += 3; if (islands.done) { clearInterval(timerId); }