This project is part of The Odin project: Ruby Chess in Ruby Curriculum.
This command-line Chess game allows two players to engage in a match directly through the terminal. The game adheres to standard chess rules, ensuring an authentic experience. Key features include:
A live demo of the Chess game is available on Replit: Play Chess on Replit
- Legal Move Validation: Prevents illegal moves and properly handles check and checkmate scenarios.
- Modular Code Design: Maintains clean, organized code to facilitate debugging and future enhancements.
- Unit Testing with RSpec: Improved my skills in writing tests to ensure code reliability and correctness.
- Object-Oriented Design: Developed a deeper understanding of modular code organization and the importance of single-responsibility principles in programming.
- Command-Line Chess Game: Develop a game where two players can play against each other directly in the terminal.
- Game Constraints: Implement rules to prevent illegal moves, with functionality to declare check or checkmate in the correct scenarios.
- Testing: Write comprehensive RSpec tests for critical components. While TDD is not mandatory, ensure that frequently used functionalities are well-tested.
- Modular Design: Maintain clean and modular code. Aim for each method and class to serve a single responsibility, aiding in debugging and maintenance.
- Chess Knowledge: If you're unfamiliar with the game, explore additional resources to understand chess mechanics and rules.
- Fun Enhancements: Enhance the game visually by incorporating Unicode characters for a more engaging game board experience.
Extra Credits
- Basic AI Player: Implement a simple AI opponent that can make random legal moves.
-
Clone the repository:
git clone https://github.com/jambalong/chess.git cd chess
-
Install dependencies:
bundle install
-
Run the game:
bundle exec ruby chess_game.rb
- Add functionality to save board state.
- Implement castling moves for both players.
- Add en passant rules for pawns.