views:

103

answers:

1

I am trying to write a match-three puzzle game like 'call of Atlantis' myself. The most important algorithm is to find out all possible match-three possibilities. Is there any open source projects that can be referenced? Or any keywords to the algorithm? I am trying to look for a faster algorithm to calculate all possibilities. Thanks.

+1  A: 

To match 3 objects using one swap, you need already 2 objects lined up in the right way. Identify these pairs first. Then there are just a few possibilities from where a third object can be swapped in. Try to encode these patterns.

For smaller boards the easy brute force algorithm (try out all possible swaps and check if three objects line up in the neighborhood after a swap) may be sufficient.

Sorry, I can't say much more without a more precise description.

Landei