Connect Four: Play Free Against the Computer, a Friend or Online

Play Connect Four free against the computer at several levels, a friend on the same device or someone online (as a guest or on the Hive blockchain), with variants: connect 3, 5 or 6, bigger and smaller boards, Pop Out, PopTen-style rules, misere, three players and your own size.

Play against
Level
You go

    Keys: 1–9 (and 0 for column 10) drop a disc, Shift + number pops (Pop Out); on the board ← → + Enter; N new game, U undo, W fill window, F full screen. Your games and settings stay in this browser.

    Connect Four, and every way to play it

    Drop your discs, line up four and keep the other player from doing the same. Play the classic 7 × 6 game against the computer at four levels, against a friend on the same phone or computer, or online: as a guest with a link, or on the Hive blockchain where every move is signed and kept for good. Then try the variants: Pop Out (pop your own disc out of the bottom), misère (four in a row loses), Connect 3 for beginners, Connect 5 and Connect 6 on bigger boards, smaller and bigger boards for four in a row, three players, and any board you like from 4 × 4 to 12 × 10. Nothing to install and no account.

    How strong is the computer?

    Easy
    Plays mostly at random (with a liking for the middle), only sometimes takes a win or blocks yours. Good for young children.
    Medium
    Always takes a win, never hands you one on a plate, and looks four moves ahead, but often picks a good move instead of the best one.
    Hard
    Searches the game tree with alpha-beta pruning for about a second, typically 12 to 16 moves ahead on the classic board in the middle game, using threats on odd and even rows (the way Victor Allis solved the game in 1988) to judge positions. Very hard to beat.
    Expert
    The same engine with three times the thinking time. Near the end of a game it sees every move to the finish.

    Tick Show the computer's score to see what the Hard engine thinks of every column: "Win in 5" means you can force a win in five of your moves, "Lose in 3" means that column loses by force, and numbers show which side stands better. It is a good way to learn why the middle column matters.

    How Hive games work

    A Hive game is a series of small signed messages from your Hive account (custom_json operations with the id mes_c4, signed with your posting key, never your active or owner key). The host opens a game, the other player joins, and each move is one operation with its move number. Both browsers read both accounts' histories from a Hive node and replay the moves with the same rules, so they always agree and nobody, not even mes.fm, can change a move or the result. A player who stops answering for five minutes on their turn can lose by a "claim", judged by block times. You can also save the result of a game against the computer or a friend to your account; that is marked as self-reported, because the moves were not signed one by one as they happened.

    Questions

    Who wins Connect Four with perfect play?
    The first player. It was solved in 1988 by James D. Allen and, independently, Victor Allis: the first player wins by starting in the middle column. Starting in the two columns next to it leads to a draw, and any other first move loses with perfect play.
    What is the best strategy?
    Take the middle column, build threats (three in a row with an empty space) rather than just blocking, and watch which row a threat is on: the first player wants threats on odd rows (1, 3, 5 counted from the bottom), the second player on even rows. Two threats at once usually win.
    What is Pop Out?
    A variant from the original makers: instead of dropping a disc you may pull one of your own discs out of the bottom row, and the column drops down. It turns blocked positions into new chances, so games rarely end in a full board. If a pop gives both players a line, the player who popped wins.
    How does online play work?
    Make a game, send the link, and the board updates for both of you within a second or two. Moves are checked on mes.fm's server so nobody can cheat or play out of turn. If the other player disappears for three minutes on their turn you can claim the win.
    Can I play on a phone?
    Yes: tap anywhere in a column to drop a disc there. Fill window and Full screen make the board as big as your screen.
    Is there an undo?
    Yes, against the computer and against a friend on the same device (not in online games).

    Related: Tic-Tac-Toe · Backgammon · Minesweeper · Poker · All MES tools

    Comments
    Advertisement