Traditional Chess, playable from the command line, written from scratch in Ruby.
A Chess game you can play here. You can play against a simple-minded CPU that makes random moves or another human. It enforces the main rules of the game, including restricted piece movements and check/checkmate, and includes the essentials features such 6 types of pieces, castling, pawn promotion, en-passant, being multiplayer, a colored board and black/white team colors. I've used modularization to organize code into feature-specific files, classes to model individual pieces and concepts such as the board and gameplay loop, and YAML serialization to save and load games.
- Win by putting your enemy in checkmate
- Move around the board and take enemy pieces
- Play Human vs Human, or Human vs AI
- Save and load your games from the main menu
- Unicode graphics and color
Link to the live replit where you can easily play it from your browser. Just hit the green run button and wait a moment for the dependencies to install.
Step-by-step instructions on how to run chess from your very own terminal! Note: You will need to have Ruby and Git installed.
- Install Ruby. If you need some help with this, here is a great resource for installing Ruby on MacOS and Linux
- Clone this repo, if you need help, GitHub has a great article on how to clone a repo.
- Navigate into this repo with
cd chess
- Run
bundle install
to install Gemfile dependencies. - Run
ruby main.rb
to launch the game. - Play!
- Replit occasionally changes how they render the terminal, making the board's visibility at risk at times