Ok, we have this project where we have to code this game:(adsbygoogle = window.adsbygoogle || []).push({});

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 que of numbers which is equal to the number of rows of the board.

So far as an algorithm we have, find a spot that will cause numbers to cancel (trivial obvious step) and then try to find the position in which more numbers get canceled. If the current number in the que cannot be placed somewhere to cancel anything, then look at the next number in the que and try to place current number to cancel that value.

The program has to be written in C and libraries are allowed, any ideas would be welcome.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Algorithm Ideas?

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads for Algorithm Ideas |
---|

Insights Intro to Algorithms for Programming - Comments |

Python Verlet algorithm and Lorentz force trajectory |

C/++/# Is there a flaw in my longest common subsequence algorithm? |

C/++/# Finding duplicates algorithm |

Perceptron algorithm initial vector |

**Physics Forums | Science Articles, Homework Help, Discussion**