Sorry, I'd have to do the same as you've been doing: pencil and paper and think think think. I'm not going to do that, the part you're trying to skip out on right now is the most important learning phase of this project. I suggest you take a break and let the problem go for a while. I'm sure the next time you're on the toilet an idea will pop into your head. That's the way it goes in the wonderful world of programming - its not about being able to come up with solutions on the spot, its about managing frustration when you're stuck.
The last thing you want to be doing is tossing in the towel, going to a forum and have yourself told how you should have done it yourself - you'll never have a good feeling about finishing this project then. Please, do everything in your (will) power to crack this one yourself.
gimbal2...how did you manage to crack the algorithm? can you give me some tips? i think i am approaching it the wrong way (work ethic)...so here is what i am doing:
paper pencil: drew the grid on the paper, numbered the coordinates, now i am trying to create a formula that will relate the queue numbers to the grid...so first, I need to get the coordinates of all the empty boxes (easy)...then i need to select the first empty space and see if the queue number will fit there...if not then move on to next empty space...if the queue number fits there (the surrounding numbers will disappear) ..then i need to get the coordinates of the empty cells again since the number of empty cells changed..and basically repeat this process...
but the problem arises when a number doesn't fit in any empty space...then i need to get a number from the queue such that this number when placed in a empty space will create an opportunity for the next number in queue to fit in another empty cell close by....that is the part i am struggling with...
The project is due next week, but I don't really care, i mean i can get over 60 percent with what i have at the moment, according to my TA.
But i need to solve this in my lifetime or I will go insane!!!!
TIME TO VISIT THE THINKING PAD! (THE TOILET)
And the first half of your post just HAPPENS to be about 100% IDENTICAL to this post from almost 5 years ago?
shawshank 09-04-2009, 05:21 PM
Ok, we have this project where we have to code this game:
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.
jwenting, it was just a project description I copied because it is the same project that person had, defeats the purpose of me writing down a brand new description.
All I was asking for was a guidance into HOW to crack the algorithm, as I though I was approaching it wrong. Nevertheless, i got it to solve the puzzle, now I am working on to find the optimal solution. Thanks for your USELESS comment about NOTHING.