From ed4c6209d79b91847af65e8a04f52023857289d3 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 09:28:29 +0000 Subject: [PATCH] Refactor Knights Puzzle layout Move interactive to the left and add goal state image. --- src/components/KnightsPuzzle.tsx | 65 +++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/src/components/KnightsPuzzle.tsx b/src/components/KnightsPuzzle.tsx index 1bbca55..9780ae9 100644 --- a/src/components/KnightsPuzzle.tsx +++ b/src/components/KnightsPuzzle.tsx @@ -183,30 +183,51 @@ const KnightsPuzzle = ({ - {/* Yellow: Main interactive with controls */} - - -
-
- {board.map((row, rowIndex) => row.map((piece, colIndex) =>
handleSquareClick(rowIndex, colIndex)}> - {renderPiece(piece)} -
))} + {/* Interactive and Goal State side by side */} +
+ {/* Left: Interactive game */} + + +
+
+ {board.map((row, rowIndex) => row.map((piece, colIndex) =>
handleSquareClick(rowIndex, colIndex)}> + {renderPiece(piece)} +
))} +
+ + {/* Controls */} +
+ + +
- - {/* Controls */} -
- - + + + + {/* Right: Goal state */} + + +
+
+ {targetBoard.map((row, rowIndex) => row.map((piece, colIndex) =>
+ {renderPiece(piece)} +
))} +
+ + {/* Goal label */} +
+

Goal State

+
-
-
-
+ + +
{/* Purple: Initial and Target positions side by side */}