This is a simple terminal-based chess game implemented in Java. Players can enjoy a game of chess by inputting their moves via the terminal. The game displays the current state of the board, captures pieces for both white and black players, turn count, and the active player's turn.
- Java JDK (version 8 and higher)
- Terminal or Command Prompt
-
Clone this repository to your local machine using:
$ git clone /~https://github.com/detds/chess-system-java.git
-
Navigate to the
src
directory:$ cd chess-system-java/src/
-
Compile the Java source files:
$ javac application/Program.java
In this chess program, the following piece abbreviations are used:
K
- KingQ
- QueenR
- RookN
- KnightB
- BishopP
- Pawn
These abbreviations represent the different chess pieces on the board.
Moves are specified by providing the source position and the target position. For example, to move a pawn from a2 to a4, you would input: Source: a2, Target: a4. Make sure to use the correct notation for the source and target positions to execute your moves successfully.
-
Open your terminal and navigate to the
src
directory. -
Run the compiled Java program:
$ java application.Program
-
The chess board will be displayed.
-
Select the piece you want to move using the following format as an example:
Source: a2
-
The game will show possible movements for the selected piece.
-
Input the target position for the selected piece using the following format as an example:
Target: a4
-
The game will validate your move, update the board, and display the new state.
-
Continue playing by alternating turns and inputting your moves as described above.
- Terminal-based chess game.
- Interactive gameplay with player input.
- Displays the current state of the chess board.
- Keeps track of captures for both white and black players.
- Shows the turn count and the active player turn.
- Validates user input and updates the board accordingly.
- Display of possible movements for selected pieces.
- Clear and user-friendly interface.
Contributions are welcome! If you find any issues or want to add enhancements, feel free to submit a pull request. Please follow the existing coding style and guidelines.
- Fork the repository.
- Create a new branch for your feature/bugfix:
$ git checkout -b feature-new-feature
- Commit your changes:
$ git commit -am "Add new feature"
- Push to the branch:
$ git push origin feature-new-feature
- Submit a pull request.
This project is licensed under the MIT License.