TicTacToe 1
I’m refactoring the TicTacToe game I’m making for my apprenticeship with 8th Light. I’m essentially starting from scratch based on the paired programming session I had with Kevin on Friday. Paired programming is actually pretty sweet, each person gets a mouse and keyboard and can jump in whenever. Anyway, I started by defining all my classes (Game, Player, ConsoleUI, Board) and quickly wrote what I think would be necessary actions within these classes. For instance, my Game class has a method called start, which essentially kicks everything off. I created the ConsoleUI class to handle any sort of interaction the player will have with the console. Kevin suggested it, and it makes a lot of sense since that means that all the methods that put anything on the screen or take any input from the player are in the same place. Once I got everything essential down, without much code written, I started to go through the paces of playing the game and adding logic and pseudo code where necessary, and that’s about where I am right now. It’s a bit different then the first-time around when I approached it more from an actions stand-point. In other words, the first time around I focused purely on the methods and logic and created my domain structure to fit the needs of those methods. This time around, I’m focusing more on domain structure and seeing how I can be creative with how I define my methods within those constraints. You can follow along with my progress here. the commit is called “deleted old code”.
Till next time.