Hello,
I am writing a Connect-4 computer game based on the classic "board game." It is written in C++ as a Console Mode program. For those that don't know, you have a 7x6 "board" filled with empty slots.
000000
000000
000000
000000
000000
000000
000000
It is a 2 player game where each player (let's use symbols 1 and 2 respectively) tries to connect 4 of their markers in a variety of ways. For example:
EXAMPLE 1 EXAMPLE 2 EXAMPLE 3
000000 000000 000000
000000 020000 010020
111100 002000 020020
000000 000200 000020
000000 000020 000020
000000 000000 000000
000000 000000 000000
Get the picture? Pretty simple? My question is: what routine would I write to check if player 1 or 2 is the winner and how would I implement it? I used a "brute force" routine for Tic-Tac-Toe (only 3x3; just took awhile to code), but I don't want this to take quite so much work. Any suggestions?
Thx for your help!,
cpp4ever