Mail Archives: djgpp/1997/11/30/23:40:50
Does anyone know of an algorithm to look through 2 dimensional array and
find 3 values next to each other. Let's say I have an array 10x10 and
it's all zeros exept at some points where it's some value and I want to
check if there is a connection between the values and if 3 of them are
connected then i want to clear them to zero.
ex.
0 0 0 0
0 x x 0
0 x 0 0
0 0 0 0
this is one of the cases, and there could be more than 3 connected and all
of them have to be cleared. The connections can only be on the sides, not
diagonal.
Thanks.
,,,
(0 0)
+-------------oOO----(_)-------------------+
| Andrew Deren |
| aderen AT eecs DOT uic DOT edu |
| www.eecs.uic.edu/~aderen/ader/main.html |
+-------------------------oOO--------------+
|| ||
ooO Ooo
- Raw text -