Tic-Tac-Toe
Noughts and crosses against the computer โ easy or unbeatable.
Playing
You are X; click a square. Easy mode plays randomly (though it will still take a win sitting in front of it) and is beatable by anyone learning the game. Unbeatable mode plays perfectly: the best you can achieve is a draw, and the score line will confirm it with quiet smugness. Who opens alternates each game, since moving first is an advantage.
Why perfect play is possible
Tic-tac-toe is small enough to solve outright: at most 255,168 possible games, which the unbeatable mode explores with minimax โ for every legal move it assumes you also play perfectly, and picks the move whose worst case is best. Solved games always end in a draw between perfect players; the only way anyone ever wins is the fork, two threats at once, which is also the only lesson the game has to teach.
Best practical opening is a corner โ it creates the most fork chances against imperfect defence (centre is the strongest square, but a corner punishes more mistakes). Chess is emphatically not solved, but its clock is here: the chess clock. For games where you can actually win, Minesweeper and 2048 are next door.
Frequently asked questions
Can I beat the unbeatable mode?
No โ it plays minimax-perfect tic-tac-toe, so a draw is the ceiling. If it ever loses, that would be a bug worth reporting.
What is the best first move?
Centre is objectively strongest, but a corner wins more real games: it sets up the double-threat forks that punish imperfect replies.
What is a fork?
Two winning threats created at once โ the opponent can only block one. Forks are the only route to victory in tic-tac-toe.
Is easy mode purely random?
Almost: it moves randomly but will take an immediate win if one is available, which keeps it honest without making it clever.