
-----------------------------------
ericfourfour
Sat Mar 24, 2007 1:42 pm

Connect Four Function
-----------------------------------
This function returns true if there is a connect four within a grid. It can actually work with any number of connections (it doesn't have to be 4).

All you have to do is send in the amount of connections, the colour id, the position to search from, and the grid.

Parameters:
amount: the amount of connections in the line required.
id: the number the chip is represented by in the grid.
x: the starting x position.
y: the starting y position.
xInc: leave as 0.
yInc: leave as 0.
grid: the grid containing all of the chip numbers.

fcn connect (amount, id, x, y, xInc, yInc : int, grid : array 0 .. *, 0 .. * of int) : boolean

    % If the coordinate is in the grid and the position is the correct id.
    if x >= 0 and x = 0 and y 