Got Homework?
Connect with other students for help. It's a free community.
Here's the question you clicked on:
 0 viewing
how do i go about programming this:(JAVA)
You have to put the numbers 18 in the eight available cells in such a way that no number borders a consecutive number, even diagonally.
 one year ago
 one year ago
how do i go about programming this:(JAVA) You have to put the numbers 18 in the eight available cells in such a way that no number borders a consecutive number, even diagonally.
 one year ago
 one year ago

This Question is Closed

Chris2332Best ResponseYou've already chosen the best response.0
I would create a map of each cell and its adjacent cells. Then make sure that the number in the cell does not have a consecutive number in any of the adjacent cells. Create a loop to try the different combinations.
 one year ago

Chris2332Best ResponseYou've already chosen the best response.0
The mathematical solution can be found here: http://www.geeksforgeeks.org/forum/topic/fillnumberspuzzle
 one year ago

snarkBest ResponseYou've already chosen the best response.0
you can write it as a backtracking problem  label boxes to fill from 07, and successively try to put a number in it: while (boxnumber < 8){ // if 8, are done ...put unused number in box ...test conditions ...if ok boxnumber += 1 // on to the next ...if not erase last try if more numbers to try, try next else backup a level, erase number there, and try next number the annoying part is keeping track of everything.
 one year ago

snarkBest ResponseYou've already chosen the best response.0
my sleazy python program finds 16 solutions
 one year ago
See more questions >>>
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.