A console-based chess game implemented in Ruby. Challenge yourself or a friend to a classic game of chess!
- Full chess rules implementation
- Visual board representation in the console
- Highlighting of valid moves
- Check and checkmate detection
- Ruby (version 3.0 or higher)
- Bundler (optional, for managing gems)
-
Clone the repository:
git clone https://github.com/DianaMLaC/Chess.gitcd chess -
Install the required gems:
gem install bundlerbundle install
After cloning the repo and installing the required gems, cd chess/lib
-
Start the game by running:
ruby chess.rb -
Use the arrow keys to navigate the board and press space to select a piece and its destination.
-
If the piece has valid moves, the piece will be highlighted with magenta and its moves with yellow.
-
No moves that put your king in check will be available.
-
The game will notify you if you're in check, and you must make a move to get out of check.
-
Pieces that can't get your king out of check won't be selected.
- Arrow Keys: Move the cursor
- Space: Select/deselect a piece and confirm its move
- Navigate to the project directory.
- Run the tests using RSpec: rspec
- Add your test cases in the spec directory.
- Run RSpec to see your tests pass: rspec
Contributions are welcome! Please fork the repository and create a pull request with your changes.