5 in a row

by Nicholas on August 1, 2009

in software

In my discrete mathematics course, our last project was to write a program that would play the game Gomoku, or more commonly known as 5 in a row; tic-tac-toe style.
The requirements are as follows:

1. Written in Java.
2. A move must be made by the program within 60 seconds.
3. The program has to draw a board after each turn.
4. The program stops running after it loses or wins and displays the result.

After a long discussion, my group decided to use an algorithm that would calculate the “beneficial” and “danger” level of each square after every human turn.  It would then choose the appropriate square to place its move.

For more information about our algorithm, read our report here.

For our program, download it here.  Run the java file in command prompt.

This program cannot be sold or modified without the consent of the programmers; intended for educational purposes only.

Leave a Comment