Week 3 begins with SQL… Not the most glamorous of languages, but functional nonetheless. I can’t say that I enjoyed diving into it and trying to do multiple joins and subqueries to return data that would have been pretty easy to get otherwise, but I’m looking forward to seeing how we are going to implement it into our programs.
Week 2 done! This week was all about getting comfortable using classes to build our projects, and after building checkers, chess and poker, I can say that I have a much better understanding today than I did when the week started.
We also dedicated today to writing our own testing specs using rspec, which I did not find fun at all. However, I do see the utility of using them and I know that it will be important to get very familiar with them, which I plan on doing
Tackled Checkers today as a solo project. Taking a cue from our work on the Chess project, I decided to get a basic gui implemented first. Again, I think it helped a lot to introduce that part first and then revisit it later once the game mechanics have been fleshed out. I was very pleased with the way my game turned out, it included all the basic rules of checkers, and I implemented a lot of error raising/rescuing which helped speed up the development process.
We finished up our chess project today, compete with super fancy graphics, using a little assistance from a gem called colorize. Catching all of the possible errors took longer than expected, but by the end of the day we had a pretty decent looking chess game with all the right logic.
After looking at the solution, I see a lot of areas that our code could have been improved. For one, we ended up putting everything in one file, which definitely made finding things a pain. Lesson learned!
We built a (mostly) working chess prototype today, laying the groundwork to finish it tomorrow. We actually built it “backwards”, designing our rendering system to output the game closer to the beginning. Doing it that way made it feel more concrete and actually made our testing easier, since we were able to visually check if something worked rather than having to rely solely on error messages and finding functionality quirks (which we still saw plenty of!). We also spent some time refactoring some of the messier parts of our code, abstracting a lot of pieces into their own methods and trying to keep the program flow clean and DRY. tomorrow we will work on finishing up the game mechanics and polishing the user interface.