i Am given a problem to solve the Bubble breaker puzzle Game.
there are two parts of the game.
1.User player
2.Cpu Player.
i wrote the code for the User player but have no idea how the Cpu player will play in such a way so that the cpu player can get maximum score and completly clear the board.
if someone can help me with this??
when the game starts its load a file containg integer ranging b/w 1 and 3.
1 for red colour
2 for green
3 for yellow
1111111111
2323333132
1131123222
2222222113
1111111111
1111111111
1111111111
1111111111
adjacent colours shold be delete.
a game like this.
plz help me out with the cpu player by giving me hints to get the best score.
thanks in advance.
If you just need a “good” score instead of the perfect score, you can use Monte Carlo techniques. The basic idea is:
Randomly select a position to click on. Do that until there’s no possibility to remove any balls. Remember the score and the points where you clicked on.
Do this 10000 times, and you will be fine against most humans.
If you still need to get a better AI player you can take the maximum score you gained above as a lower limit. You would then estimate the maximum points that can be reached from a certain position, and if that number is less that the “best random score”, you can cancel that particular try.