Ok, we have this project where we have to code this game (classic mode):
http://www.mathsisfun.com/games/addemup.html
The point of the game is to place numbers in empty boxes in a 2D array of numbers such that the the 8 surrounding positions when added have the number in the middle as the last digit of the sum.
Here is an example:
1 2 3
4 4
5 5 4
the sum of those numbers is 1+2+3+4+4+5+5+4=28. Since 8 is the last digit of 28, then putting an eight in the middle would make all boxes around it become empty. Anything else and the number is just placed in the empty box (for example if u put 7 there).
Also, you have a queue of randomly generated numbers...see the above link for the gameplay of the game.
So far i have programmed it for interactive play, so the user can put the correct number in the empty spot and the surrounding numbers will disappear.
What i am having trouble with is the computer play. The computer has to automatically solve the game. I just need a starting guide as to how to come up with this algorithm, programming is not an issue..just this STUPID ALGORITHM!! pulling my hair over it..
Any ideas where to begin? i am trying to do the old paper pencil method in coming up with the optimal method to solve the game..but every time I come up with something I find out that it would not work for other numbers (the numbers are randomly generated)...ANY ANY ANY help would be appreciated. Thanks.