Question about a connect-four style system...

Blitz3D Forums/Blitz3D Beginners Area/Question about a connect-four style system...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

To check if there are four in a row, you just start at the first peice, and move across to the right... If you see a red peice, increment the counter by 1. If you see a peice which is not red, reset the counter to 0. If the counter is then equal to 4, then you have four in a row.
Of course, that only checks for horizontal rows. You will probably need to check for vertical rows if you don't find any hor. ones. And if you don't find any hor. or ver. rows, then you will probably have to check for diagonal ones (which is a bit trickier, but definitely not impossible).


This thread may contain some helpful/useful information...