From 14a42eff17d26fc56850408e8928a781c14323f5 Mon Sep 17 00:00:00 2001
From: Azalea <22280294+hykilpikonna@users.noreply.github.com>
Date: Mon, 16 Dec 2024 05:21:06 -0500
Subject: [PATCH] [F] Fix puzzle loading
---
src/App.svelte | 43 ++++++++++++++++++++++---------------------
1 file changed, 22 insertions(+), 21 deletions(-)
diff --git a/src/App.svelte b/src/App.svelte
index ae6606f..1041e93 100644
--- a/src/App.svelte
+++ b/src/App.svelte
@@ -9,7 +9,7 @@
const [rows, cols] = [40, 40]
const [eRows, eCols] = [rows + 1, cols + 1]
let numbers = Int8Array.from({ length: rows * cols }, () => 0)
- let numberMasked = Int8Array.from({ length: rows * cols }, () => 0)
+ let numberMasked = Int8Array.from({ length: rows * cols }, () => 1)
let hedgeStates = Int8Array.from({ length: eRows * eCols }, () => 0)
let vedgeStates = Int8Array.from({ length: eRows * eCols }, () => 0)
@@ -22,23 +22,17 @@
const [ sx, sy, ex, _ ] = edge
const isVertical = sx === ex
if (isVertical) {
- vedgeStates[sy * (eCols) + sx] = 1
+ // vedgeStates[sy * (eCols) + sx] = 1
if (ex != cols) numbers[sy * cols + sx] += 1
if (sx != 0) numbers[sy * cols + sx - 1] += 1
} else {
- hedgeStates[sy * (eCols) + sx] = 1
- // numbers[sy * cols + sx] += 1
- // if (sx != 0) numbers[(sy - 1) * cols + sx] += 1
+ // hedgeStates[sy * (eCols) + sx] = 1
+ if (ex != rows) numbers[sy * cols + sx] += 1
+ if (sx != 0) numbers[(sy - 1) * cols + sx] += 1
}
})
}
- function clickEdge(sx: number, sy: number, tx: number, ty: number) {
- console.log(sx, sy, tx, ty)
- // const edge = edgeMap[`${sx}-${sy}-${tx}-${ty}`]
- hedgeStates[sy * (cols + 1) + sx] = 1
- }
-
// Positions for click handling
function clickDiv(event: MouseEvent) {
const target = event.target as HTMLElement
@@ -58,6 +52,7 @@
Slither Link
+ {#if editMode}