Connect Four

Back to projects list

CanvasData structuresGame searchHTML UI

Connect Four is a slightly more elaborate game than tic tac toe. Instead of being able to put a mark anywhere on the board, pieces are dropped into columns from the top of the vertical board and fall to the lowest open position in the column. It is a two-player game with the goal of each player to get four in a row of their color horizontially, vertically, or diagonally before their opponent.

A UI for Connect Four could probably be reasonably built either by drawing it on a Canvas or via an HTML UI. An extra whizzy UI would animate the falling of the pieces but that is definitely not a requirement. As with other computerized board games, the program should probably ensure that only legal moves are played.

Connect Four is more complex than tic tac toe but less complex than chess or go so it might be a good project if you want to experiment with game search techniques. You probably can't brute force it the way you can with tic tac toe but it should be easier to write a function to evaluate a given position for Connect Four than it is for chess.

References