diff --git a/_posts/2018-04-12-chess-2-(rust).md b/_posts/2018-04-12-chess-2-(rust).md new file mode 100644 index 0000000..4d0d87f --- /dev/null +++ b/_posts/2018-04-12-chess-2-(rust).md @@ -0,0 +1,40 @@ +--- +layout: post +title: Chess 2 (Rust) +date: 2018-04-12 +categories: + - projects +description: An implementation of the Chess variant Chess 2 written in Rust +image: https://raw.githubusercontent.com/richardguerin/Chess-2/master/Chess2.PNG +author: Ricky Guerin +author-image: https://avatars0.githubusercontent.com/u/14082463?s=460&v=4 +author-bio: Third year member of Computer Science House, Computer Science major +author-email: richardguerin10@gmail.com +author-social: + github: https://github.com/richardguerin + linkedin: https://www.linkedin.com/in/richard-guerin/ +--- + +*What is this project?* + +A few months ago, I stumbled upon a chess variant called Chess 2. It allows players to choose from 6 interesting armies and adds a new win condition to breathe a lot of life into a centuries old board game. As a life-long lover of Chess, I was thrilled. Sadly the only way to play it on a computer was in a poorly-made Steam game. Wanting to bring this wonderful game to more people, I decided to FOSS it up and make my own implementation. Around the same time, I got interested in learning about Rust. To kill two birds with one stone, I used the development of this game as a vehicle to help me learn about Rust. + +So, the idea for this project was to: + +* Learn about Rust +* Implement Chess 2 as a command line app +* Make Chess 2 available on crates.io +* Stretch goal: Make a networked version of Chess 2 +* WAY distant goal: Make some kind of web client for Chess 2 + +*Current state of the project?* + +After working on it on and off for some weeks, the rules of the game are almost all implemented. When the program is run, two players can choose which army they will play as, the board will be displayed, and the players can take turns inputting moves to move their pieces around the board and capture enemy pieces. The system of checking and checkmating is not done, but I expect to have that done soon. After the game is complete, I'll take a break and then get to distributing the game and making the networked version. + +*What did I learn?* + +The main "what did I learn" here is that I now feel comfortable working in Rust. It took a while for me to get over not having inheritance, but I love how Rust is composed of ideas from all kinds of different languages. Moving forward, I can and absolutely will use Rust as my go-to language when making projects like this. + +*Challenges / What would I do differently?* + +It's hard to say what I would do differently because I am still working on this project and since I began working and experimenting at the same time I began learning Rust, I was held back by misunderstandings that I had about Rust. The biggest instance of this is when trying to define the behavior for each piece, I kept trying to make each piece a different struct while also having one data structure that can hold any combination of these structs and that sort of pseudo inheritance just wasn't working out, so I had to do a big ol' refactor, and I have since gotten over that hurdle.