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:

https://github.com/ijoshsmith/swift-tic-tac-toe

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:

test_<method-under-test>_<condition>_<expected-result>

You will need the latest Xcode to build this project.

Enjoy!

Next article: Creating Tic-tac-toe in Swift: Gameplay and data model

About Josh Smith

Josh Smith is a musician at heart, and a software developer by obsession. He lives in Arizona, plays classical music on the piano, jazz on the guitar, and enjoys brutally long rides on his bicycle. He has a wonderful wife and thinks that, in general, life is good.
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.