From 38d77bcc7c4c5a75923ddce63f18392c9c3c08cd Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Wed, 23 Mar 2022 21:36:44 +0100 Subject: [PATCH] Tweaked difficulty --- src/algo.ts | 6 +++--- src/globals.ts | 10 +++++++++- src/views/GameView.vue | 23 +++++++++++------------ 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/algo.ts b/src/algo.ts index 70b0dc9..5a2a76e 100644 --- a/src/algo.ts +++ b/src/algo.ts @@ -117,7 +117,7 @@ export function isSolvable(result: number, plaquettes: number[]): boolean { histories.push(history) if (!found) { found = true - console.log(`1e solution trouvée en ${Date.now() - start}ms`) + console.log(`1st solution found in ${Date.now() - start}ms`) } return } @@ -138,12 +138,12 @@ export function isSolvable(result: number, plaquettes: number[]): boolean { loopOperations(plaquettes, []) if (found) { console.log( - `Réussite : ${Date.now() - start}ms et ${numberOfIterations} iterations`, + `Success : ${Date.now() - start}ms and ${numberOfIterations} iterations`, ) } else { console.log( - `Echec : ${Date.now() - start}ms et ${numberOfIterations} iterations`, + `Failure : ${Date.now() - start}ms and ${numberOfIterations} iterations`, ) } diff --git a/src/globals.ts b/src/globals.ts index 0084b75..1569508 100644 --- a/src/globals.ts +++ b/src/globals.ts @@ -7,10 +7,18 @@ export const LSK_STATS = 'n0_stats' export const operators = ['+', '-', '*', '/'] as const -export const pools = { +export const normalPools = { + 1: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 25, 50], + 2: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], + 3: [5, 5, 5, 5, 5, 2, 2, 2, 2, 2], + 4: [1, 1, 2, 3, 5, 8, 13, 21], +} as const + +export const advancedPools = { 1: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 25, 50, 75, 100], 2: [2, 2, 3, 3, 5, 5, 7, 7, 11, 13, 17, 19, 23], 3: [5, 5, 5, 5, 5, 2, 2, 2, 2, 2], + 4: [1, 1, 2, 3, 5, 8, 13, 21], } as const export enum GameStateType { diff --git a/src/views/GameView.vue b/src/views/GameView.vue index 8787e66..5a2917e 100644 --- a/src/views/GameView.vue +++ b/src/views/GameView.vue @@ -1,3 +1,4 @@ +advancedPools