The goal of this project is making a complete Chess game in ruby.
This is the final project in Ruby path from The Odin Project
a demo gaming.
You can play it on replit.
- Two players with legal moves
- Save and Load feature
- Optional AI(Still working on it)
-
I have been looking forward to this project for quite some time. I had a peek on various occasions, and every time that I looked I thought to myself, how should I finish this? Here we are. I FINISHED!
-
I took some time thinking about how I should start, and after some thoughts I decided to start with the board and how to represent the chess pieces.
- After rendering the board in a way that doesn't look too ugly, I put my focus on how to handle the pieces.
- Started creating classes for each piece and each one of them have their respectively movement, color and special rules.
-
When the board was handle and the pieces were rendered in the board correctly I started working on the rules like 'en passant' and castle, this was without a doubt the hardest part of this project.
- Many, many bugs happens during the implementation of the rules, well it was my fault for no using rspec for testing.
-
The save and load feature was "Easy" to implement , I learned the differences between YAML, JSON and Marshal. I decided to use YAML for the simplicity.
Well the project is not over, I still need to implement the AI method and refactor the code, my code is not pretty but am glad with it. I've learned so much in the last month that is hard to put in words how happy am I right now.
Time to take some fresh air.