fix multiple pickedHoles

master
Peter Babič 3 years ago
parent c2ab50f3cd
commit 3b66d8a961
Signed by: peter.babic
GPG Key ID: 4BB075BC1884BA40
  1. 6
      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) {

Loading…
Cancel
Save