Skip to content

kithaca/ruby-chess

Repository files navigation

ruby-chess

This is a 2-player implementation of chess, written entirely in Ruby.

To play, clone the repo and type "ruby game.rb" into your terminal.

Use arrow keys or WASD to move the cursor. Use enter or spacebar to select a piece. The selected piece will be highlighted in green. Use enter or spacebar to select the destination of the piece.

Features

  • All chesspieces inherit from a Piece class
    • Queen, Rook, and Bishop inherit from Sliding class
    • King, Knight, and Pawn inherit from Stepping class
  • Error handling for improper moves
  • Deep dup of chessboard and pieces to perform move validations without chainging game state

Screenshots

Start

start

Piece capture

pre-capture post-capture

Castling

pre-castling

post-castling

Check

check

Checkmate

fools_mate

Future Features (TBD)

  • En passant, draw
  • Option to turn chessboard around for each player's turn
  • Option to undo last move
  • Show captured pieces
  • Store famous chess games as sequence of moves; allow play-through

About

Console-based two-player chess game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages