Six dots, fifteen lines, and why a draw is impossible
Sim is a two-player game played on six dots arranged in a circle. Every pair of dots is joined by a line, making fifteen lines in total. You take blue, the computer takes red, and you claim one unclaimed line each turn. The first player to complete a triangle of three lines in their own colour loses. The remarkable property of this game is that a draw is mathematically impossible: no matter how the fifteen lines are coloured between two colours, a single-colour triangle must appear. That is the smallest case of a result from Ramsey theory, and it is the reason this game always has a winner.

Rules of the game
Six dots sit in a ring, and every pair is connected by a grey line. There are fifteen lines in total, because six dots taken two at a time gives fifteen pairs. You go first, claiming lines in blue. The computer responds with red. A claimed line cannot be taken back or changed.
You lose if three of your blue lines connect three dots to form a triangle. The computer loses the same way if three red lines form a triangle. Lines of mixed colours meeting at three dots do not count at all. Only a triangle where all three sides are the same colour triggers a loss. Since a draw cannot happen, every game ends with exactly one loser. The game highlights the losing triangle when it forms, so you can always see exactly which three lines ended the round and learn from the pattern.
Controls and how to play
Tap or click any grey line to claim it. It turns blue. The computer thinks for a moment and claims a line in red. The game alternates until someone completes a triangle. When the losing triangle forms, it is highlighted on the board so you can see exactly which three lines caused the loss.
The Computer selector sets the difficulty. Easy makes the computer look ahead only a few moves. Normal searches deeper. Hard goes further still, and beating it requires careful planning. At every level the computer uses alpha-beta search to evaluate positions, measuring how many safe lines each side has left. A new game button resets the board at any time.
Scoring and what counts as a win
You win when the computer completes a single-colour triangle in red. Your score is the number of blue lines you claimed during the game. The best score across sessions is tracked in your browser. Since the game has no draw state, every round produces either a win or a loss.
The stats panel shows three numbers: your lines, their lines, and how many lines remain unclaimed. Watching the third number is important, because as it drops the board gets more crowded and safe lines become scarce. The winner is typically the player who still has safe moves when the other runs out.
Difficulty levels and how the computer thinks
The three difficulty settings control the depth of the computer's search tree. Easy looks three moves ahead. Normal looks five. Hard looks seven. Deeper search means the computer is more likely to spot a trap you are building and to avoid walking into it.
At every level the computer evaluates a position by counting how many lines are still safe for each side. A line is safe for you if claiming it would not complete a triangle of your colour. When the computer runs out of safe lines, it is forced to lose on its next turn, and that is how the game is won. The computer tries to reach a state where your safe lines run out before its own do.
Strategy: spread your lines across the board
The fundamental trap in this game is clustering. If you claim several lines around the same dot, the chances of three of them forming a triangle increase sharply. Two blue lines sharing a dot means any third blue line between the other two endpoints creates a triangle. So the safest early play is to spread your claims across different parts of the board.
Lines that share no dot can never form a triangle together, because a triangle needs three dots and each line uses two. If your first three claims all connect different pairs of dots with no dot repeated, no triangle is possible among them regardless of the geometry. That is the cleanest opening. As the game progresses, spreading becomes harder because the board gets more crowded, but the habit of checking whether a new claim shares a dot with your existing lines is always worth the moment it takes.
Strategy: forcing the computer into a corner
You do not win by building something. You win by making the computer run out of safe lines. That is a subtle shift in thinking. Instead of asking which line is safe for you, ask which line will leave the computer with the fewest safe responses.
One effective tactic is to claim a line that threatens to complete two different triangles on the computer's next turn. The computer can only block one of them, which leaves the other open. This kind of double threat is the most reliable path to a win, especially against the harder difficulty settings where the computer will not hand you a cheap triangle.
With perfect play the second player has the advantage in this game, which is why the computer lets you go first. Winning as the first player against a strong computer requires setting up these double threats early, before the board gets crowded enough for the computer to block everything.
Common mistakes and how to avoid them
The most common mistake is claiming a line without checking both of its endpoints. Before you click, look at each dot at the end of the line. If you already own a line from each of those two dots to some third dot, then claiming this line completes a triangle and you lose. That single check is all you ever need to make, and it takes only a moment.
Another frequent error is playing defensively when you should be attacking. Avoiding your own triangles is necessary, but it is not enough. If you only play safe lines without putting pressure on the computer, it will eventually force you into a corner where every remaining line completes one of your triangles. Offense and defense must happen together.
A third mistake is ignoring the line count. When only a few lines remain, the board is almost full, and every unclaimed line is likely to be dangerous for one side or the other. Keeping track of how many safe options each side has helps you judge whether to press or to hold back.
The mathematics that makes a draw impossible
The impossibility of a draw follows from Ramsey theory. The specific fact is that the Ramsey number R(3,3) equals six: among any six people, either three of them all know each other or three of them are all strangers. Restate that with dots and coloured lines, and it says that colouring all fifteen edges of a complete graph on six vertices with two colours must produce a single-colour triangle.
The proof is short. Pick any dot. It has five lines. By the pigeonhole principle, at least three of them must be the same colour. Consider those three lines and the triangle they form with the dots at their far ends. If any line of that triangle is the same colour, you have a single-colour triangle. If none are, those three lines are all the other colour, and they form a single-colour triangle themselves. Either way, a triangle appears.
Privacy and how the game runs
The whole game runs inside your browser tab. Nothing is uploaded, there is no account, and your best score is stored on this device only. Once the page has loaded it works offline, so you can play on a train or a plane with no connection. The computer's alpha-beta search happens entirely on your own processor. The board is drawn as a scaled vector graphic that adjusts to any screen size, so the dots and lines are clear on a phone as well as a desktop.
Because there is no server involved, the computer cannot cheat. It searches the same move tree every player would search by hand, just faster and deeper. The game is a fair contest between your strategy and the computer's look-ahead, with no hidden information on either side.
