Friends scan this code to open Tic-tac-toe on their phone.
How to play
3×3 classic
Two players take turns putting their mark, X or O, in an empty square. X always moves first.
Get three in a row across, down or diagonally to win.
If all nine squares fill up with no line of three, the game is a draw. With perfect play on both sides, every game is a draw.
Five in a row
The same idea on a 15×15 board: the first to get five in an unbroken line (across, down or either diagonal) wins. Six or more in a line also wins.
Watch out for an open four (four in a row with both ends empty): it can't be stopped. An open three becomes one next turn, so block it early.
If the board fills up with no winner, the game is a draw.
Modes
vs Computer: play X (you start), O (the computer starts), or alternate who starts each game.
Easy plays mostly at random but grabs a win when it sees one. Medium wins and blocks, but a fork (one move that makes two threats at once) can catch it out. Hard never loses at 3×3; at five in a row it blocks your threats and hunts for chains of fours that force a win.
2 players: share one device. Name each player and choose whether X alternates between you.
Score and buttons
The score counts each player's wins and the draws, game after game, until you change the game settings.
Undo takes back your last move (and the computer's reply). Rematch starts the next game; a game you restart halfway doesn't count. Reset sets the score back to zero.
Controls
Tap or click an empty square to place your mark.
Keyboard on the 3×3 board: 1 to 9 pick a square in reading order (1 top left, 9 bottom right).
On either board, the arrow keys move a highlight and Enter or Space places your mark.