From b961a011ea492bba00ec05f27ce4b58f17f16362 Mon Sep 17 00:00:00 2001 From: Francisco Navarro Morales Date: Mon, 15 Jan 2024 15:28:59 +0100 Subject: [PATCH 1/4] Count moves right --- src/components/ChessPuzzle.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/ChessPuzzle.vue b/src/components/ChessPuzzle.vue index 9d736c3..16a1d77 100644 --- a/src/components/ChessPuzzle.vue +++ b/src/components/ChessPuzzle.vue @@ -103,6 +103,7 @@ onMounted(() => { }) function goBack () { + moves-- boardAPI?.undoLastMove() invalidMove.value = false } From c6166e9e7c9e8a97ecbd5411b66244d0c88f478f Mon Sep 17 00:00:00 2001 From: Francisco Navarro Morales Date: Mon, 15 Jan 2024 15:29:15 +0100 Subject: [PATCH 2/4] Remove debug line --- src/components/TrainingSession.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/TrainingSession.vue b/src/components/TrainingSession.vue index b33eaf6..1fa3176 100644 --- a/src/components/TrainingSession.vue +++ b/src/components/TrainingSession.vue @@ -31,7 +31,6 @@ function nextPuzzle () { // get a random index from unplayedPuzzles const randomIndex = Math.floor(Math.random() * unplayedPuzzles.length); currentPuzzle.value = unplayedPuzzles[randomIndex]; - console.log(currentPuzzle.value) } nextPuzzle() From 261445f4aef0b0ae5ce4def469cda46bd5d8faf7 Mon Sep 17 00:00:00 2001 From: Francisco Navarro Morales Date: Mon, 15 Jan 2024 15:29:38 +0100 Subject: [PATCH 3/4] Update router --- src/typed-router.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/typed-router.d.ts b/src/typed-router.d.ts index 59519dd..4a25df5 100644 --- a/src/typed-router.d.ts +++ b/src/typed-router.d.ts @@ -40,7 +40,6 @@ import type { declare module 'vue-router/auto/routes' { export interface RouteNamedMap { '/': RouteRecordInfo<'/', '/', Record, Record>, - '/__tests__/dashboard': RouteRecordInfo<'/__tests__/dashboard', '/__tests__/dashboard', Record, Record>, '/[...all]': RouteRecordInfo<'/[...all]', '/:all(.*)', { all: ParamValue }, { all: ParamValue }>, '/homepage': RouteRecordInfo<'/homepage', '/homepage', Record, Record>, '/nested/menu1': RouteRecordInfo<'/nested/menu1', '/nested/menu1', Record, Record>, From 3d3aeea9be391a4b6e9fb744e8426c1128d0e5c3 Mon Sep 17 00:00:00 2001 From: Francisco Navarro Morales Date: Mon, 15 Jan 2024 15:30:22 +0100 Subject: [PATCH 4/4] log correct move --- src/components/ChessPuzzle.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/ChessPuzzle.vue b/src/components/ChessPuzzle.vue index 16a1d77..5c86dd1 100644 --- a/src/components/ChessPuzzle.vue +++ b/src/components/ChessPuzzle.vue @@ -81,6 +81,7 @@ function handlePlayerMove (move: MoveEvent) { pendingMoves = pendingMoves.slice(1) runEnemyMove() } else { + console.log('Invalid move, the correct move is: ' + pendingMoves[0]) invalidMove.value = true new Audio(errorSound).play() }