4 in a row


4 in a row for windows is the ultimate Four in a row (also known as Connect Four) challenge for you. It offers multiple levels of play, an extremely strong computer opponent, load and save game functions, and a tutorial. When playing against 4 in a row, you will probably lose most of the time. I know this is frustrating from my own experience; to give weaker players (such as myself!) a chance, there is a beginner level, and (new in version 4.0!), the option to dumb down the evaluation function.


4 in a row for Windows v. 4.01 (Setup program, 1.1MB); updated October 14, 2007; the recommended version.
4 in a row for Windows v. 4.01 64-bit version (Setup program, 1.1MB)
4 in a row for Windows v. 1.2 (403 KB). This is the older version, which I just left here for historical reasons.
4 in a row source code (42 KB) new! - I will probably not develop 4 in a row further, so I decided to publish the source code. If you do happen to find any improvements, please tell me about them!


To install v4.0, just run the setup program and follow the instructions. To install v1.2, unzip all files in the archive in a new folder. Run 4inarow.exe (c4.exe) to play. To uninstall, just trash the folder again.


Feedback can be sent to nospam1 at fierz dot ch.


I started programming Four in a Row around 1992 when a fellow physics student (Andri Schaufelbühl) and I both wrote a program to see who could make the better one. I moved on later to programming checkers and chess (check out the links at the top of the page!), but I've still been improving four in a row from time to time. Right now, 4 in a row v4.0 is one of the fastest-searching connect four program around for windows.
a screenshot of connect four

Links to 4 in a row resources

  • Wikipedia on Connect Four
  • Mustrum - a very nice and strong connect 4 program for windows by Lars Bremer. It has an 8-ply database which helps it play openings perfectly, whether it starts the game or not. Highly recommended!
  • ConnectFour3D is a rather new and very good connect four program. It uses openGL to display the board in a 3D setting, and, with the help of a 70'000-move opening book, it can play perfectly within seconds. The author claims that it is the fastest perfect-playing connect four program around. Apparently, it makes use of parts of an older program called DeutFour, and it appears that the help file was inspired by the help file for my 4 in a row :-)
  • Four or more is another good connect four program by Martin Bauer.
  • John Tromp's connect four playground: A Java applet which plays connect four perfectly - amazing!
  • Velena plays a perfect game with the help of a 60'000 move opening book but unfortunately it's written for DOS.
  • I've written a tutorial on four in a row strategy which is also included with my program. It gives you an idea of basic strategy. For deeper understanding try the following two:
  • James D Allen independently solved connect four. He has an article on expert play in connect 4 available. Much more advanced than my tutorial.
  • Velena is based on Victor Allis' solution of connect four. You can get his master's thesis as a PDF. Heavy stuff!


4 in a row would not exist in this form without Andri Schaufelbühl, Bernhard Seybold, Ed Gilbert, Lars Bremer and Uta Hermanns. Thank you!
This page has been visited times since 1/1/99. ...powered by

This page was last updated on August 7, 2008 using arachnoid