Summary

Play Noughts and Crosses with Charles, and discover how our love of games can teach AI new tricks.
school Degree program
label Research theme

Research themes

This activity is part of our Science Lab series. Check out the ANU Science Lab for more experiments! In this activity, you will learn how AI learns to play games through an "unplugged" computer science challenge using noughts and crosses (tic-tac-toe) to discover how algorithms, rules, and strategies power artificial intelligence. Watch the video above to see how it's done.

Unplugged AI game materials & ingredients

For this activity:

  • A few sheets of paper
  • Pens or pencils in two different colours
  • A partner to play against
  • A list of written rule cards (or a notepad to draft your algorithm)

How to play unplugged AI tic-tac-toe: Step-by-step instructions

Step 1: Practice and reflect on strategy

  1. Draw a standard 3x3 grid on a piece of paper.
  2. Play a few casual rounds of noughts and crosses with your partner, taking turns placing "O" and "X" marks.
  3. Pause and discuss the mental choices you made. Did you automatically pick the centre square or target the corners? Write down every implicit decision you made as a clear instruction.

Step 2: Test a basic rule set (Algorithm 1)

Draft a basic set of strict rules (your "algorithm") on paper for both players to follow without deviating:

  • Rule 1: If the centre square is available, place your mark in the centre.
  • Rule 2: If you have two marks in a row, place your third mark in that row to win the game.
  • Rule 3: If a corner square is empty, place your mark in a corner.
  • Rule 4: If all corners and the centre are filled, place your mark in an empty side square.

Play a round against your partner where both players must strictly follow these four written rules only, without making up new moves on the fly. Notice how easily a player can lose if the algorithm lacks defensive logic!

Step 3: Upgrade your algorithm (Algorithm 2)

To stop the first player from winning every time, add a defensive blocking rule to your algorithm:

  • New Rule (Blocking): If your opponent has two marks in a row, place your mark in the remaining space to block them from winning.

Re-play the game using the updated rule set. Observe how introducing a single new rule changes the outcome from a quick defeat to a stalemate (draw).

How does game-playing AI work? The science explained

This unplugged activity models the fundamental principles of computer science, rule-based algorithms, and decision trees used in artificial intelligence.

In computer programming, an algorithm is simply a step-by-step set of instructions that tells a machine how to solve a problem.

When computer scientists design artificial intelligence to play games:

  • Rule-Based Systems: Human programmers write precise logic (if-then statements) that instruct the AI on how to evaluate the game board and choose the optimal move.
  • Algorithmic Flaws: If a human programmer forgets to include a defensive rule, the AI will make silly mistakes and lose, just like in your first game round.
  • Reinforcement Learning: Modern AI systems do not just follow hardcoded human rules. Instead, they play millions of games against themselves, automatically refining their internal algorithms and discovering winning strategies through trial and error.

Developing game-playing AI is not just about entertainment! Computer scientists use the same decision-making logic developed in game environments to solve complex, real-world problems such as training self-driving cars to avoid hazards, optimizing robot navigation, and helping emergency teams coordinate responses during natural disasters.

Science fair projects & taking it further: Experimenting with variables

Once you have mastered noughts and crosses, try extending your AI rule-building skills to test new challenges:

  • Complex Games: Try writing a complete written algorithm for a more complex game like Connect Four or Checkers. How many extra rules do you need to write to account for the larger board size?
  • Asymmetrical Algorithms: Create two completely different rule sheets. Give Player 1 an aggressive, attack-focused algorithm and Player 2 a purely defensive algorithm. Which strategy wins more often?
  • Machine Learning Simulation: Assign points to your rules. Each time a rule leads to a win, add 1 point to its priority rating; if it leads to a loss, subtract a point. Watch how your "paper AI" evolves its strategy over 10 rounds!

Enjoyed this experiment? Explore more hands-on activities on the Science Lab ANU YouTube channel.

Asset type
Science at home

Related content

Subscribe to receive new experiments as they become available