Skip to content

A Ruby implementation of Chess to be played in the terminal.

Notifications You must be signed in to change notification settings

LukasErekson/RubyChess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RubyChess

A Ruby implementation of Chess to be played in the terminal.

See the landing page and play online by clicking here.

Table of Contents

  1. Features
  2. Requirements
  3. Installing & Playing
  4. Documentation
  5. Developing & Contributing
  6. Acknowledgements

Features

This implementation features all the standard rules of chess, including some things such as castling the king, the situational move En Passant, and pawn promotion to a player's choice of pieces. It also allows players to quit a game early, saving the state of the board and turn history in the saves folder as a YAML file.

Requirements

Ruby 2.7+ is required. The gem colorize also needs to be installed in order for the board and chess pieces to render correctly.

Installing and Playing

To install and play, simply clone the main branch with

git clone https://github.com/LukasErekson/RubyChess.git

Then, run ruby lib/main.rb in the downloaded RubyChess directory. A game menu will appear giving you options to start the game, load a saved game, or quit.

Gameplay

At any point during the game, typing help or tutorial will provide detailed instructions on how to make moves (and if you're in check, it will provide a list of moves that you can take to get out of check).

The basic gist of the gameplay consits of typing in the location of the piece you would like to move and then typing the locaiton where you would like it to go. The following syntax is accepted to move a piece from f1 to c4:

  • f1c4
  • f1 to c4

Make a move image

To exit the game early, type quit, and you will be prompted to give a name for the save file before the program exits to the main menu.

Doucmentation

Be sure to check out the RDoc generated documentation by clicking here.

Developing and Contributing

Testing

A custom test suite with over 100 tests written with RSpec tests the major functionality of the game pieces and the board. It can serve as a good benchmark for anyone who wishes to contribute to the repository while maintaining stability. I also used SimpleCov as one measure of completeness to make sure niche cases were reached and methods behave as expected.

Contributing

Feel free to fork this repo and build on it in any way! I welcome any pull requests that aim to improve the quality of the project. As a matter of fact, it would give me some more experience reviewing others' code and going through pull requests.

Acknowledgements

This serves as a capstone project for The Odin Project's Ruby Programming course. The whole repository is also an opportunity to practice the standards of a git repository and trying out a new workflow. Although this project is done on my own, I hope that the way I use git provides me with good practice at developing software in team-friendly way.

I'm grateful for the chance to learn from a free and open source cirriculum like the Odin Project.

About

A Ruby implementation of Chess to be played in the terminal.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages