Tic-tac-toe, Computer vs. human

exercise No. 159

Q:

This exercise is beyond the current lecture's scope. Feel free to solve it at your own discretion if you are desperately searching for a more challenging problem.

Your solution should allow for humans playing tic-tac-toe against a computer:

Figure 440. Two Tic-tac-toe players fighting each other.

The underlying logic is considerately more difficult to implement and requires recursion as being introduced in the section called “Factorial, the recursive way”. You may want to read:

A: