Normally I blog about a program I’ve already written. I decided this time to take a different approach, and blog about a Tic-tac-toe program that I’m writing instead. This will give people who are interested in watching a Swift program evolve over time the chance to follow along. As I add new features and refactor the code, I will post about it on this blog.
The repository is on GitHub:
My first committed class is GameBoard. It is the data model that stores the state of a game, namely which positions have been marked with X’s and O’s.
That class’s unit tests are here. The test method naming convention I use is:
You will need the latest Xcode to build this project.
Next article: Creating Tic-tac-toe in Swift: Gameplay and data model