From 3b66d8a961e97355b4829fa4608bdfa962105e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Babi=C4=8D?= Date: Sun, 3 Jan 2021 14:03:18 +0100 Subject: [PATCH] fix multiple pickedHoles --- src/App.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index c7ff526..ccb6b60 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -63,9 +63,9 @@ jumps.addEdge(11, 14) const change = clicked => { - const indicesofHoles = [...state.keys()].filter(i => state[i]) - const possibleJumps = jumps.adjacencyList[clicked].filter(hole => - indicesofHoles.includes(hole) + const emptyHoles = [...state.keys()].filter(i => state[i] == emptyHole) + const possibleJumps = jumps.adjacencyList[clicked].filter(jump => + emptyHoles.includes(jump) ) if (state[clicked] == standingPole && possibleJumps.length > 0) {