Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 1.81 KB

README.md

File metadata and controls

49 lines (33 loc) · 1.81 KB

Chess

A two-player command-line chess game written in Ruby and tested with RSpec.

This is the final assignment for the Ruby section of The Odin Project.

Play online on replit

Screenshot of Board

Features

  • Ability to save and load games
  • When a piece is selected, highlight all possible moves that the piece can make
  • Tastefully designed board using ANSI escape codes
  • Allows special moves such as castling, en passant and promotion
  • Tested with RSpec

How to Use

To play online, go here.

To play locally, you must have Ruby installed. This program was written in Ruby 3.1.

If you have Ruby installed:

  • Clone this repository
  • Navigate to the top-level directory
  • Type ruby lib/main.rb in your terminal
  • Follow the instructions and enjoy the game!

If you wish to run the tests, you must have RSpec installed and type rspec in the terminal. The tests were written using RSpec 3.11.

Known Bugs

  • If playing a saved game, further saving is not possible

Possible Improvements

  • Improve test coverage by writing more tests, especially integration tests
  • Allow players to start a game from a FEN string
  • Improve the feedback that is given to players
  • When a piece is selected to move, highlight opponent pieces that can be captured in red
  • Implement ability to play against AI
  • Code refactoring

Reflections

This was an absolute mammoth of a project. There were many long periods of struggle and numerous multi-hour debugging sessions. However, despite the difficulties and intense obstacles that had to be overcome, this was an incredibly fun project.

(more to be added later)

Acknowledgements