Connect Four/Four in a Row game
Here's a simple Connect Four game written in Microsoft Visual Basic 6.0. The game has the following options:
-Set who plays first. (red or yellow)
-Whether one of the players is the computer, and if so, which color it plays with.
When the computer player is enabled, it used the following strategy:
1. Check if a winning move can be made.
2. If no winning move can be made, check whether the human player can make a winning move and block it.
3. If no moves have been made during steps 1 or 2, check whether an existing row can be made longer or make a random move without allowing the human player to make a winning move.
4. If no move was made during step 3, make a random move in an available slot regardless of other factors.
EDIT:
Mostly for the challenge, I decided to convert this game to Quick Basic, probably not very useful practically speaking, but interesting: http://www.vbforums.com/showthread.p...27#post5024127
Re: Connect Four/Four in a Row game
Nice one Peter, thanks for sharing. ;)