Play chess!
Branch: master
Clone or download
Pull request Compare This branch is 3 commits ahead, 1 commit behind alaughlin:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

##Chess Terminal-based Chess game, coded in pure, beautiful Ruby. Fully-functional and filled with fun features!

To play, clone the repo. Then use the terminal to navigate into it and type: ruby chess.rb

###Fun Features:

  • Pieces render into appropriate unicode characters.
  • Board is colorized using fazibear's 'colorize' gem:
  • Castling moves are supported when the player tries to move the king to a valid castling position.
    • First, our rook checks if there are any obstructing pieces in the castle's path using its own move logic.
    • Then, we dupe the board for each position the king would move into in transit. If any position represents a check, it is not a valid castle.
  • The board checks itself for stalemate (no possible moves, not in check) after each move.
  • Pawn Promotion -- after each move, a pawn will check whether it is in the enemy's closest row. The user will then be prompted to choose a promotion piece.
  • Support for saving/loading a game
    • Board state is saved into a YAML file, which can be reaccessed upon subsequent executions of the game file.
  • Captured pieces are displayed to the right of the board.


  • en passant (crazy pawn logic!)
  • other draw conditions (identical board states, no captures in 50 moves)