finding chains in a Multiarray?

Blitz3D Forums/Blitz3D Programming/finding chains in a Multiarray?

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.

start with something like this and work with it:
this shows checking rows...
Dim chainlength(100)
numchains = 0
For y = 1 to 10
	For compare = 1 To 10
		thisspot = Grid(compare, y)
		count = 1
		If thisspot < 10
			For iter = 1 To 9
				If thisspot = Grid((compare + iter) - 10 * ((compare + iter) > 10), y)
					count = count + 1
					Grid(compare, y) = 10
					Grid((compare + iter) - 10 * ((compare + iter) > 10), y) = 10
				Else
					Exit
				EndIf
			Next
		EndIf
		If count > 1
			numchains = numchains + 1
			chainlength(numchains) = count
		EndIf
	Next
Next
Of course this code corrupts the grid (for checking columns later). To work around that, you can modify the code or create a copy of the grid first.