The Algorithm Design of Candy Crush

Started by
10 comments, last by Dragonsoulj 10 years, 10 months ago

Hi guys,

I would like to know how would you will design the core algorithm of CANDY CRUSH? Any one got idea?

com.supergames.candycrushsaga_94396700_0

Advertisement

You need to be more specific.

In terms of representation, they can be stored in an array or a list.

You need to be more specific.

In terms of representation, they can be stored in an array or a list.

Here what I mean is that algorithm to traverse the board to find out which candy need to be remove.

Is this one of these "Match 3 in a row" games?

Just check if the two flipped objects are connected to 2 more equal objects, if yes remove all of them, if not flip back.

You could use a flood fill to find and count the objects http://en.wikipedia.org/wiki/Flood_fill

Is this one of these "Match 3 in a row" games?

Just check if the two flipped objects are connected to 2 more equal objects, if yes remove all of them, if not flip back.

Yes, It's kind of "Match 3 in a row" game.

How you got to implement this rule? Use recursion or backtracing? How to organized those objects, the board should be traverse each time.

Thanks,

you can use a bit map to store the types of candy. the player can change only two of them each time. so you just scan and check the ranks of them.

You could use a flood fill to find and count the objects http://en.wikipedia.org/wiki/Flood_fill

Hi @Hedman, Great answer! It's helpful... biggrin.png

You could use a flood fill to find and count the objects http://en.wikipedia.org/wiki/Flood_fill

Hi @Hedman, Great answer! It's helpful... biggrin.png

learning...

I am working on a match 3 game, but it also matches irregular pieces connected to the original match. For that I am using the flood fill already mentioned on the thread.

This topic is closed to new replies.

Advertisement