Skip to content

Ed-A/Knight-Chess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Knight Chess

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.

Features

  • 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.

How to Play

  1. Open the webpage and you will see a 5x5 board with a knight placed on it.
  2. Click on the knight to display its valid moves.
  3. The valid moves will be highlighted in orange.
  4. Click on a highlighted square to move the knight to that position.
  5. The process can be repeated for any new knight position.

Files

  • 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.

How it Works

  • 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.

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/knight-chess.git
  2. Open index.html in your browser to start playing the game.

Contributions

Feel free to open issues or submit pull requests if you'd like to improve the project!

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

OOP for Knight

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors