Bubble puzzle

I have been given a problem to solve a Bubble Breaker puzzle game. There are two parts to the game. Player 1.User Player 2.Cpu. I wrote the code for User, but I don’t know how the Cpu player will play in such a way that the cpu player can get the maximum result and completely clear the board. if anyone can help me with this?

when the game starts its download, a file containing an integer specifying b / w 1 and 3. 1 for red 2 for green 3 for yellow

1111111111
2323333132
1131123222
2222222113
1111111111
1111111111
1111111111
1111111111

adjacent colors will be removed.

a game like this . Plz help me with cpu player by giving me tips to get the best result. thanks in advance.

+3
3

"" , , -. :

. , - . , .

10000 , .

- AI, , , . , , , " ", .

+2

.

11...
23...

arr[0][0]=1; 
arr[0][1]=1; 
arr[1][0]=2; 
arr[1][1]=3; 

:

//using arr[0][0] as the base point
if ( (arr[0][0])==(arr[0][1])) //look in your right
{
   //explode
}
if ( (arr[0][0])==(arr[1][0])) //look below
{
   //explode
}
if ( (arr[0][0])==(arr[1][1])) //look at lower right (diagonal)
{
   //explode
}
0

, . , :

  • ? 3 ? 4 ? 5?

  • , , ? ? ? ?

  • - . ?

, .

. , 2x2 , :

[a][b]
[c][d]

: a-b, c-d, a-c, b-d = 4.

4 .

, 4x4 , , .

0
source

Source: https://habr.com/ru/post/1779814/


All Articles