Four Wins 1.2 — Connect Four against a search engine.
Four Wins is Connect Four for Android, iPhone, iPad and Mac. The opponent is neither a language model nor a random number generator, but a negamax search with alpha–beta pruning, move ordering from the centre outwards and a transposition table. On the highest level it searches iteratively as deep as it manages in 1.4 seconds — about thirteen plies on an empty board.
The search always runs on the device. The app requests network access only for games against other people, and has no accounts, no ads and no analytics. The game logic has no interface dependencies — Kotlin on Android, Swift on iPhone, iPad and Mac — and is covered by unit tests on both sides.
One app, two code bases. The Apple version is a native SwiftUI rebuild, not a port of the Android interface: same rules, same texts, same hints. Where the platforms differ, this manual says so: the Dynamic colour scheme and the “Rate the app” button, for instance. Statistics and settings are kept per device and are not synchronised.
Seven columns, six rows, one disc each in turn. The disc always drops to the lowest free slot of the chosen column. Whoever first lines up four of their own discs — horizontally, vertically or diagonally — wins the game. If the board fills up and nobody has four in a row, the game is a draw.
By default you play the gold discs and open. With the Machine opens option the opponent takes the first move.
Tapping a column drops the disc in. A full column takes nothing more, and while the machine is thinking the board is locked — a tap then does nothing rather than swallowing a move.
| Ring | Meaning |
|---|---|
| green, solid | You win in this column on your next move. |
| red, dashed | The machine wins in this column on its next move. |
| gold | The column of the hint you last asked for. |
Green and red can be switched off with the Show threats option. The gold ring only appears after you request a hint and disappears with the next move.
Below the board the move order runs as a horizontally scrolling chain: one disc in the colour of whoever moved, with the column number. After a loss it is worth a look — the threat usually appears two or three moves before the end.
Four levels are available. Search depth is given in plies; a ply is one side's move.
| Level | Search depth | Time budget | Deliberate mistakes |
|---|---|---|---|
| Easy | 2 plies | 0.12 s | 40 % of moves |
| Medium | 4 plies | 0.40 s | 10 % of moves |
| Hard | 7 plies | 0.70 s | none |
| Unbeatable | up to 14 plies, iterative | 1.40 s | none |
Deliberate mistakes: with the given probability, Easy and Medium pick not the best but another legal move. That makes them beatable without making them obviously wrong.
The level applies at once, including the game in progress. For the statistics, the level that was set when the game ended is the one that counts.
Under Opponent, the machine can be swapped for a second human. The two then take turns on the same device: player 1 plays gold, player 2 plays steel. The Player 2 opens switch reverses the order.
Switching starts a new game — carrying a position half-played against the machine over into a two-player game would be neither one thing nor the other. The difficulty picker disappears while two people are playing; there is no machine for it to apply to.
No hint, no statistics. The machine's analysis would sit in the open on a screen both of you are looking at, so the button is gone. And the statistics are broken down by difficulty, which does not exist against a human: two-player games are not counted.
Undo and the threat rings stay. With two players, Undo takes back a single move, not two — there is no machine reply waiting.
Two people on two devices play the same game. On the play screen under Opponent tap Over the net: one side creates a game and receives a six-character code, the other types it under Code and joins. Whoever created it sits on seat 0 and opens with gold.
The two sides need not run the same platform: an Android device and an iPhone can play against each other.
Only the moves travel. Each device works out the position itself, and since Connect Four has no randomness the same board necessarily comes out on both. The server does not know the rules; it keeps the move sequence of the running game in memory and forgets it after three hours without use. The address is built in and cannot be changed — the code does not carry the server with it, so two people with different addresses would never meet.
During a net game the strength, the tip, Machine opens and Undo are hidden: the first three belong to the machine, which is not playing, and a move taken back would still stand on the other side. Net games are not counted and are not saved when the app closes.
If the other player leaves — or their connection drops for longer — play continues: on seat 0 the machine takes over the free side and the position stands, on seat 1 a new game starts, because there the colours would not match.
Suggests a column, marks it with the gold ring and names the reason:
The move is only played once you tap the column yourself. While the machine is thinking, the hint is locked. In Two players mode the button does not appear at all.
Takes back your last move together with the machine's reply, so it is your turn again in the same position. Repeatable back to the start of the game. While the machine is thinking, the button is locked. With two players it goes back a single move.
Clears the board. An abandoned game does not count towards the statistics — only games played to the end are recorded.
Every finished game against the machine on this device is counted. Two-player games are left out.
The numbers live in a private preferences file belonging to the app and survive a restart. Reset statistics deletes them for good; from the drawer the app asks first.
System default follows the device's dark mode. Light and Dark apply regardless. The choice survives a restart.
Ten schemes: Gold (default), Blue, Green, Purple, Orange, Red, Teal, Pink, Grey and Dynamic. The scheme colours buttons, selected chips, the navigation bar and the progress bar.
The board keeps gold against steel. With Blue or Teal your discs would otherwise share a colour family with the machine's.
Dynamic picks up the colours of the wallpaper (Material You) and is available from Android 12 on, on Android only. On older Android devices and on iPhone, iPad and Mac the entry does not appear, so the Apple version has nine schemes.
System default follows the device language and falls back to English if that is neither German nor English. German and English apply regardless. Switching takes effect at once, without a restart, and the game in progress is kept.
On Android, Rate the app opens the Play Store listing; the Apple version offers it once the app is in the App Store. The same route sits on the help page under Contact & support, there alongside Send feedback, Share the app and Show the intro again.
These two switches live on the play screen under Tools, where they act:
Three tabs sit at the bottom: Home, Play and Settings. The button with three lines at the top left opens the drawer with all six destinations — additionally Statistics, Help and Info — plus three actions: new game, give a hint and reset statistics.
The drawer opens by button only. A swipe from the left edge would collide with the horizontally scrolling move history on the board.
Game state does not belong to the screen: switching tabs mid-game loses nothing, and the machine finishes its move even while the statistics are open.
It also survives closing the app. The move order is saved along with the difficulty and the options; on the next start it is replayed. A game that was already counted does not count a second time.
On wide windows — tablets, iPads, unfolded devices in landscape and Mac windows — the board and the controls sit side by side rather than stacked. The board is capped in width: bigger discs are not easier to hit.
On first launch an intro runs across five pages: welcome, how to play, the rings on the board, hint and undo, and the four difficulty levels. Page through with Next or by swiping; Skip ends it at once.
The two middle pages show no drawn picture but a real board with a position in which both sides threaten. The rings on it are not painted but computed by the game logic — what you see there you see again, unchanged, in the game.
Once finished, the intro does not come back on its own. Under Help › Show the intro again it can be brought up at any time.
Four Wins uses the network, and only for games against other people: on Android through the
INTERNET permission, on the Mac through the sandbox's outgoing connections, on
iPhone and iPad without any permission prompt. When you play the machine or two players, the app
sends nothing. It asks for no other permission. Only two things are stored, both on the device: the
statistics and the settings for appearance, colour scheme and language. Both disappear when the
app is uninstalled. See the privacy policy.
Questions, bugs and wishes are welcome by email at agrauf67@gmail.com. Via Help › Contact & support › Send feedback the app opens a prepared mail with the version number in the subject.
The same section holds “Rate the app”, which on Android opens the Play Store listing, and “Share the app”, which passes the link on through an app of your choice — on Apple devices the link to the website, until there is an App Store listing.
Frequently asked questions are answered on the help page.