Game: Connect Four, but extremely strong!

Hello everyone,

You can always win the game Connect Four if you follow this guide: VierGewinnt.pdf. But that’s boring. Thinking for yourself is where the practice comes from! Back in my university days, I once had to write an algorithm (in C code) that was as strong as possible and would win whenever possible. (I didn’t know the textbook solution back then).

4.dsk (190,3 KB) (run"4")

Here is my version of the game. Try to win, or at least force a draw. The controls should be self-explanatory.


I’d be happy if you gave this seasoned old game a quick look.


The Panel (Right Side)

The panel displays everything important regarding the current game.

  • MODUS (MODE)
    Shows WETTKAMPF (COMPETITION) or LERNSPIEL (TRAINING). The switch is controlled by the difficulty level or an UNDO.

  • ZUG (MOVE)
    The number of pieces placed so far. On the right is the upper limit /42 (full board).

  • VORTEIL (ADVANTAGE)
    Shows the evaluation of the position from the program’s perspective:
    → AUSGEGLICHEN: (BALANCED) Neither side has a clear advantage.
    → DU / CPC with number: (YOU / CPC with number) Shows who has the advantage. If the outcome is proven, the number represents the count of pieces the winner still needs (22 minus piece count). The bar below roughly indicates the advantage.

  • The bar moves slowly to the new evaluation so you can see the change.

  • Additional line “DU SIEGST IN N” / “CPC SIEGT IN N” (“YOU WIN IN N” / “CPC WINS IN N”)
    Only appears when the outcome is proven. N is the number of moves the winner has left, counted from now. Without a proof, nothing is shown there.

  • KNOTEN and TIEFE (NODES and DEPTH)
    → KNOTEN:** Number of calculated positions. Shows how much work the CPC has done.
    → TIEFE: How far into the future the CPC has calculated, in half-moves (ply).

  • Messages
    The text under the bar indicates whose turn it is: “DU BIST DRAN!” (“YOUR TURN!”) or “ICH DENKE NACH…” (“THINKING…”). Error messages like “SPALTE IST VOLL!” (“COLUMN IS FULL!”) also appear here.

  • Key Help
    At the bottom of the panel, the keys for the game are listed.

4 Likes