Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess

Chess is a command-line implementation of the classic board game for two human players. It implements the core rules of chess, including castling and en passant, and supports saving and loading games locally.. The project emphasizes clear object-oriented design and comprehensive move validation.

Project Context

Although I no longer actively develop this project, I've chosen to preserve it as a snapshot of my early growth in object-oriented software design and rule modeling.

Features

Gameplay

  • Two-player command-line chess following the core rules of the game.
  • Supports castling and en passant.
  • Supports saving and loading games locally.

Move Validation

  • Prevents illegal moves, including moves that would leave a king in check.
  • Provides descriptive error messages explaining why a move is invalid.
  • Validates castling conditions such as attacked squares and obstructing pieces.

Interface

  • Colorized terminal display using the colorize gem.
  • Clear turn-based prompts and descriptive error messages.
  • Designed for play in a terminal environment.

Object-Oriented Design

  • Models the game through classes representing the board, pieces, players, moves, and game state.
  • Designed with extensibility in mind, making it straightforward to add additional rules, gameplay features, and computer-controlled opponents.

Technologies

Screenshot

Screenshot of a chess game showing an attempted illegal move that would leave the king in check

Gameplay  •  Illegal move validation with descriptive feedback.

Setup/Installation

To run this project locally:

  1. Clone this repository
  2. Run bundle install
  3. Run bundle exec ruby lib/main.rb

The color scheme may appear differently depending on your terminal configuration. Colors can be customized in the Display class, and String.colors lists all colors available through the colorize gem.

About

Command-line chess implementation emphasizing object-oriented design, move validation, and the core rules of the game.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages