This is what's I'm working with
Internally, there is an array of type Block, which is a struct defined as so:
What I want to do is find groups of similarly colored blocks that have four or more of them touching. In the screen shot above the hilighted blocks would be what I'm looking for.
I'm pretty much stuck here for the time being, I don't have any good ideas on how to go about finding the adjacent blocks.
Anyone able to help?
Internally, there is an array of type Block, which is a struct defined as so:
code:<HR>Code:struct Block { BlockColor color; bool highlight; BlockState state; int stateTime; //number of frames block has been in given state<P> //Constructor Block( void ) :color(EMPTY), highlight(false), state(BS_EMPTY), stateTime(0) {} };
What I want to do is find groups of similarly colored blocks that have four or more of them touching. In the screen shot above the hilighted blocks would be what I'm looking for.
I'm pretty much stuck here for the time being, I don't have any good ideas on how to go about finding the adjacent blocks.
Anyone able to help?