CSC 581: Mobile App Development
Spring 2019

HW5: Model Design & Development

For this assignment, you will design and implement the Model component of a tic-tac-toe app. The View and Controller components are provided for you in the TicTacToe project. You should first download this project and familiarize yourself with the provided code. Then, you will implement a struct named TicTacToeGame, which has the following components:

Part 1: Implement in a playground.

You should first implement and test your TicTacToeGame struct in a playground. This will allow you to try out each component of the struct independently, without the complications of the View and Controller. For debugging purposes, you will need to write a temporary method for the struct that displays the board contents. Include statements that create a tic-tac-toe game, call the different methods, and display the results.

Part 2: Integrate into the project.

Once you have thoroughly tested your TicTacToeGame struct in a playground, add it to the downloaded project. That is, add a new Swift file to the project and copy-paste your struct definition from the playground to this file. Test the complete project to make sure it behaves as described. You may then remove the temporary board display method and any other debugging code you added to the struct.

Part 3: Augment the project.

Once you have a working app, add at least one significant feature to its workings. Possible ideas include a welcome screen with author information and rules, a popover that provides help (for beginners), storing and displaying the player's win/loss record, etc. Be creative!

NOTE: you should turn in both the playground and the completed project.