Creating Tic-tac-toe in Swift

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

This entry was posted in Swift, Tic-tac-toe and tagged , . Bookmark the permalink.

3 Responses to Creating Tic-tac-toe in Swift

  1. kerryjenkins says:

    Thank you for doing this. Your writing and teaching is very much appreciated!

  2. Pingback: Dew Drop – November 30, 2015 (#2141) | Morning Dew

Comments are closed.