diff --git a/src/About.svelte b/src/About.svelte index 24d3fa4..34955e1 100644 --- a/src/About.svelte +++ b/src/About.svelte @@ -24,7 +24,7 @@

Triangles.fun

A game. Leave only a single dot to win. Eliminate other dots by jumping @@ -35,11 +35,11 @@ clicking on the darker spot.

Installation

This game can be installed into your device. Look for "Add to Home - Screen" in the browser menu. + Screen" in the browser tab menu.

Support

You can send me your feedback or complains via peter@triangles.fun - and you can even - buy me a coffee. + and help me keep this game running via + Buy Me a Coffee.
diff --git a/src/App.svelte b/src/App.svelte index c578d4f..0d092d2 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -76,6 +76,7 @@ let moveStack = [] let gameover = false let victory = false + let about = false let maxSteps $: if (variant || side) { @@ -110,8 +111,6 @@ j++ } } - - printSolutions(-1) } const undo = () => { @@ -238,62 +237,6 @@ } } - const printSolutions = maxSolutionCount => { - if (maxSolutionCount < 0) { - return - } - - let depth = 0 - let solutions = [] - let gameovers = [] - let shadow = [...circles] - const moves = new Tree("", depth) - - const recurse = move => { - if ( - maxSolutionCount != 0 && - maxSolutionCount != undefined && - maxSolutionCount <= solutions.length - ) { - return - } - - const hints = getHints(shadow) - if (hints.length == 0) { - gameovers.push(move.solution) - - return - } - - hints.forEach(hint => { - getDests(shadow, hint).forEach(destination => { - const solution = `${move.solution} ${hint}>${destination}` - const child = new Tree(solution, depth) - const lastIndex = move.children.push(child) - 1 - jumpOver(shadow, hint, destination) - depth = depth + 1 - - if (depth == maxSteps) { - solutions.push(solution) - } - recurse(move.children[lastIndex]) - depth = depth - 1 - jumpReverse(shadow, hint, destination) - }) - }) - } - - recurse(moves) - console.log(solutions) - - if (maxSolutionCount < 1) { - console.log(gameovers) - - const proportion = (solutions.length * 100) / gameovers.length - console.log(proportion.toFixed(2) + "% moves are victory") - } - } - const handleKeydown = event => { if (event.key == "u") { undo() @@ -302,8 +245,6 @@ restart() } } - - let about = false