From 9cfdf4fde22d304bb8a5a2ef50d0affe47ec71df Mon Sep 17 00:00:00 2001 From: Kotaro <71119362+kotaro-caffeinism@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:19:04 +0900 Subject: [PATCH] deem taking the outer path to the goal as the correct solution (#1) * delete "the arrow must be point down" from goal condition * fix the misalignment in the maze drawing --------- Co-authored-by: kotaro-caffeinism --- src/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/script.js b/src/script.js index e9bb494..d82ba7b 100644 --- a/src/script.js +++ b/src/script.js @@ -131,7 +131,7 @@ window.onload = () => { } const checkPosition = (index) => { - if (JSON.stringify(movingArrow.index) === JSON.stringify([550, 850]) && movingArrow.pointing === "down" && index === movements.length - 1) { + if (JSON.stringify(movingArrow.index) === JSON.stringify([550, 850]) && index === movements.length - 1) { document.body.classList.add("winner"); executeCommands.setAttribute("disabled", "disabled"); pattern.innerText = "Well done!"; @@ -211,7 +211,7 @@ window.onload = () => { // bottom (exit from 500 to 600) ctx.lineTo(500, element.height - 100); - canvasCoords.done === false ? addCanvasCoords([100, element.height - 100], [500, element.height - 100]) : ""; + canvasCoords.done === false ? addCanvasCoords([200, element.height - 100], [500, element.height - 100]) : ""; ctx.moveTo(600, element.height - 100); ctx.lineTo(900, element.height - 100); canvasCoords.done === false ? addCanvasCoords([600, element.height - 100], [900, element.height - 100]) : "";