A console-based Chess game implemented in Java, featuring all standard rules including check, checkmate, and stalemate detection. This game supports two players with basic input validation and move verification.
- Full implementation of Chess rules.
- Detection of check, checkmate, and stalemate conditions.
- Basic input validation to ensure valid moves.
- Display of the chess board after each move.
- Clone the repository:
git clone https://github.com/yourusername/chessgame.git
- Navigate to the project directory:
cd chessgame
- Compile the Java files:
javac -d bin src/chessgame/*.java src/chessgame/pieces/*.java
- Run the game:
java -cp bin chessgame.GameController
- Start the game and enter the names of the two players.
- Players will be prompted to enter their moves in turn. A move consists of the source row and column, and the destination row and column.
- The game will validate each move, check for check, checkmate, or stalemate conditions, and update the board accordingly.
- The game ends when one player checkmates the other or a stalemate is reached.
- Input moves by specifying the source and destination coordinates.
- Coordinates are in the range of 0-7, corresponding to the rows and columns of the chess board.
Alice (WHITE)'s turn
Enter source row: 6
Enter source column: 4
Enter destination row: 4
Enter destination column: 4
0 1 2 3 4 5 6 7
0 BR BN BB BQ BK BB BN BR
1 BP BP BP BP -- BP BP BP
2 -- -- -- -- -- -- -- --
3 -- -- -- -- -- -- -- --
4 -- -- -- -- WP -- -- --
5 -- -- -- -- -- -- -- --
6 WP WP WP WP -- WP WP WP
7 WR WN WB WQ WK WB WN WR
Bob (BLACK)'s turn
Enter source row: 1
Enter source column: 4
Enter destination row: 3
Enter destination column: 4
0 1 2 3 4 5 6 7
0 BR BN BB BQ BK BB BN BR
1 BP BP BP BP -- BP BP BP
2 -- -- -- -- -- -- -- --
3 -- -- -- -- BP -- -- --
4 -- -- -- -- WP -- -- --
5 -- -- -- -- -- -- -- --
6 WP WP WP WP -- WP WP WP
7 WR WN WB WQ WK WB WN WR
Alice (WHITE)'s turn
Enter source row: ...