Skip to content
dann toliver edited this page Jan 8, 2015 · 3 revisions

Problem description:

Tonight we'll be writing programs to play tic-tac-toe! If regular tic-tac-toe turns out to be too easy, try the "ultimate" version instead: http://mathwithbaddrawings.com/...­

We may have our programs play against each other, so keep that in mind when designing your interface. (You can hard code it, but have a function that takes a board and returns a new board, and an easy way to access that.)

Notes from July 2014 Toronto:

Only a couple groups managed to get working tic-tac-toe implementations, and those were mostly using random moves. Quite a few groups tried implementing minimax -- no one successfully, but 45 minutes isn't long to both learn the algo and also implement it in an off-language. Any time a group tries implementing a new algorithm from scratch that feels like a success to me. Surprisingly, no one tried hard-coding the cases for success. Next time I might present that as an option before the second round, with a pointer to a list of cases in case anyone wants to try that technique. It involves less thinking and more focus on writing code.

Overall this was a great Code Retreat problem: everyone learned something, we had a variety of partially working implementations, and it sparked good discussion in the interims. The are a number of different approaches to modeling it, it allows for tdd and uidd, there's a large number of different inputs, it's a well-known problem, and there's some interesting algorithms available while still feeling very accessible.

Repo: https://github.com/CodeRetreatTO/projects/tree/master/2014-07-tic-tac-toe

Clone this wiki locally