This is a simplified chess game featuring a single knight on a 5x5 board. The player can move the knight, and the board will highlight all possible moves based on the knight's movement rules in chess.
- A 5x5 chessboard with a single knight piece.
- Highlights all valid knight moves from the current position.
- Click-based movement: Click on the knight to display possible moves, then click on a highlighted square to move the knight.
- Automatically updates the board and resets available moves after each move.
- Open the webpage and you will see a 5x5 board with a knight placed on it.
- Click on the knight to display its valid moves.
- The valid moves will be highlighted in orange.
- Click on a highlighted square to move the knight to that position.
- The process can be repeated for any new knight position.
index.html: The main HTML structure for the chessboard.style.css: Contains the styling for the chessboard and the knight.myScript.js: Handles the knight's movement logic and user interactions.whiteknight.png: PNG format image for the knight piece.
- When the knight is clicked, the board highlights all possible knight moves (L-shaped moves typical in chess).
- Clicking on a valid square moves the knight and resets the board.
- Clone the repository:
git clone https://github.com/your-username/knight-chess.git
- Open
index.htmlin your browser to start playing the game.
Feel free to open issues or submit pull requests if you'd like to improve the project!
This project is licensed under the MIT License. See the LICENSE file for details.