MF: Project still needs to be wrapped up and updated online
On this page, you'll define the strategy that the computer will use by investigating the strategies that humans use.
You've already built into your project the most basic Tic-Tac-Toe strategy rule: the computer will move to the best empty square
on its turn. But there are other important elements to a good strategy...
The strategy rules for Tic-Tac-Toe have different degrees of priority. For example, the most important rule is "if I can win on this turn, then play in the winning square."
won?
block works by looking for a triple in which all three slots are X or all three slots are O. Describe what the slots of a triple will contain if player O can win on their next move by filling that triple's last square.
winning triple
for both inputs (X and O). Play a little more, and then test them both again. Fix any bugs.winning triple
report if there is no winning triple?winning square
for both players, and fix any bugs.On the next page you'll use winning square
to finish giving the computer a better strategy.