From fbd54b5605ab62afc905fb812caa5133bdac4564 Mon Sep 17 00:00:00 2001 From: Ido-Barnea Date: Wed, 18 Oct 2023 08:43:26 +0300 Subject: [PATCH 1/2] [#57] Fixed knight in the wrong place --- development/src/logic.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/development/src/logic.ts b/development/src/logic.ts index 216ea5f3..9127b58e 100644 --- a/development/src/logic.ts +++ b/development/src/logic.ts @@ -27,12 +27,12 @@ const blackPlayer: Player = { export const players = [whitePlayer, blackPlayer]; export let pieces = [ new Rook([0, 0], players[1]), - new Bishop([1, 0], players[1]), - new Knight([2, 0], players[1]), + new Knight([1, 0], players[1]), + new Bishop([2, 0], players[1]), new Queen([3, 0], players[1]), new King([4, 0], players[1]), - new Knight([5, 0], players[1]), - new Bishop([6, 0], players[1]), + new Bishop([5, 0], players[1]), + new Knight([6, 0], players[1]), new Rook([7, 0], players[1]), new Pawn([0, 1], players[1]), new Pawn([1, 1], players[1]), @@ -51,12 +51,12 @@ export let pieces = [ new Pawn([6, 6], players[0]), new Pawn([7, 6], players[0]), new Rook([0, 7], players[0]), - new Bishop([1, 7], players[0]), - new Knight([2, 7], players[0]), + new Knight([1, 7], players[0]), + new Bishop([2, 7], players[0]), new Queen([3, 7], players[0]), new King([4, 7], players[0]), - new Knight([5, 7], players[0]), - new Bishop([6, 7], players[0]), + new Bishop([5, 7], players[0]), + new Knight([6, 7], players[0]), new Rook([7, 7], players[0]), ]; From 5a8f841a9c1aa83eee127b6f63b9b89548001559 Mon Sep 17 00:00:00 2001 From: Ido-Barnea Date: Wed, 18 Oct 2023 08:52:19 +0300 Subject: [PATCH 2/2] [trivial] Formatting --- .prettierignore | 15 ++++----------- LICENSE => LICENSE.md | 0 development/src/pieces.ts | 6 +++++- 3 files changed, 9 insertions(+), 12 deletions(-) rename LICENSE => LICENSE.md (100%) diff --git a/.prettierignore b/.prettierignore index 4e6702e2..f4240591 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,12 +1,5 @@ -README.md -tsconfig.json -package.json -package-lock.json -LICENSE -.gitignore -.github -assets -node_modules -dist -.parcel-cache +/node_modules +/dist +/.parcel-cache +*.md nx.json diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md diff --git a/development/src/pieces.ts b/development/src/pieces.ts index 90e3c3f1..7a2aad20 100644 --- a/development/src/pieces.ts +++ b/development/src/pieces.ts @@ -318,7 +318,11 @@ function validateMove( // Check if any square along the piece's path is occupied (not including the destination square) const targetPiece = getPieceByPosition(nextPosition); - if (targetPiece && (!comparePositions(nextPosition, targetPosition) || !allowedToAttackOnLastStep)) { + if ( + targetPiece && + (!comparePositions(nextPosition, targetPosition) || + !allowedToAttackOnLastStep) + ) { return false; }