# How to maximize the score when computer plays a game

• 03-29-2008
banafsh3h
How to maximize the score when computer plays a game
I wrote the text version of a game called Virus 3, which can be found here: http://www.arcadetown.com/virus3/gameonline.asp

The only differences are: the colours are indicated by numbers, the board is rectangular, and there is no limitation as to the # of moves (there is no "game over"). Also, unlike the online game, the score will be calculated by summing the square of the number of new tiles on the virus.

I want to find a way to maximize the score when the computer plays the game. Would you care to give me some ideas?
• 03-31-2008
guesst
Quote:

Originally Posted by banafsh3h
I wrote the text version of a game called Virus 3, which can be found here: http://www.arcadetown.com/virus3/gameonline.asp

The only differences are: the colours are indicated by numbers, the board is rectangular, and there is no limitation as to the # of moves (there is no "game over"). Also, unlike the online game, the score will be calculated by summing the square of the number of new tiles on the virus.

I want to find a way to maximize the score when the computer plays the game. Would you care to give me some ideas?

Well, this is just a thought, and I'm no good at this sort of thing, but the answer to me would be to have the computer actually play the game, being sure to remember each step of the way. It could simply brute force the game until it wins playing the lowest possible number, and if the lowest possible number doesn't change the board then backtrack (undo) and eliminate that number. If it wins, and that sequence resulted in the fewest moves remember the sequence and tag with the number of moves, then backtrack. Keep going this way until every possible combination has been played.

The other possibility is to simply play each move one at a time and pick the possibility that maximizes THIS move. Easier to program, not as likely to maximize the score.