We are about to switch to a new forum software. Until then we have removed the registration on this forum.
The current algorithm is such a mess and it's not giving the right answers.
It supposed to check for each type of candy, for at least 3 consecutive candy type it will "break".
May I know a simple or at least a source algorithm for that purpose.
You may see my code on my GitHub here and the part of my algorithm here.
Thanks in advance :D
Answers
CAN you tell us the file and line numbers relevant?
And post those lines here also?
It’s good that you posted on github but it’s a lot of code
@Chrisir Sorry about that. I have added a hyperlink to the code above.
@xxMrPHDxx which match3 definition is your goal? Do you want to check for horizontal and vertical matches; do you want to check for diagonals?
See the
detectPossibleSwaps
method from this tutorial:and diagonal?
@jeremydouglass Thank you but that's not what I meant though.
Let say I have
A B C C B A B B C
I want to find all candidate for both horizontal and vertical matches given 3 or more consecutive type (From above let say the 3 B's above) and will have them all to pop out (I know I need to store all matches in an Array) after the checking done.
Anyway thanks for your reply. I appreciated that :D.
My current code is working but it's not detecting matches if the matches at the last 3 row/col. Please help :-S.
You can find my code here.
Btw this part is not needed:
I thought that could solve the problem but it's not
You might find this recent post interesting:
https://forum.processing.org/two/discussion/25413/crumple-a-collapse-like-game-framework