From 674eb6fcfa75867b4165d77afd3c95719c56dbfe Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Mon, 16 Dec 2024 22:51:02 -0500 Subject: [PATCH] [+] Timer --- src/App.svelte | 6 +++++- src/app.sass | 14 ++++++++++++-- src/utils.ts | 13 ++++++++++++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 4e33fb2..f318d87 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -2,7 +2,7 @@ import svelteLogo from './assets/svelte.svg' import viteLogo from '/vite.svg' import Number from './lib/Number.svelte' - import { cfg, eStates, JsonTy, nStates, randInt, range, zero8 } from "./utils"; + import { cfg, eStates, Fmt, JsonTy, nStates, randInt, range, zero8 } from "./utils"; import Line from "./lib/Line.svelte"; import { solve } from "./solver"; @@ -26,6 +26,9 @@ let [editMode, dragging] = [true, false] const modes = ['line', 'mask', 'color'] let mode = 'line' + let [startTime, elapsed] = [Date.now(), 0] + + setInterval(() => elapsed = Date.now() - startTime, 100) // Checkpoints interface Checkpoint { hStates: i8s, vStates: i8s, hColors: i8s, vColors: i8s, numbers: i8s, nMask: i8s, colors: string[] } @@ -256,6 +259,7 @@ Welcome to SlitherLink! 🧩 The rules are simple: Draw lines between the dots to create one big loop (no crossings, no branches). The numbers are your hints – they tell you how many lines should surround them. Left-click to draw, right-click to mark with an X. Can you crack the perfect path? +