• Post Reply Bookmark Topic Watch Topic
  • New Topic

beginner to java needs dire help  RSS feed

 
jack web
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry new to the forum, pardon me if im posting in the wrong place.

im creating a brute forced sudoku solver with recursion



because debugger in my eclipse isnt working, i cant really debug this, and im not really good at tracing by hand. but no matter how i trace it i can find the problem with it.

a main method calls this with return solve(0);
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tell The Details
 
jack web
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the solver is suppose to print out the solution of a puzzle read in by another class, when we reach the end of the sudoku board which should return true. the program will print can not solve the puzzle when no solution is found or the board is already solved which returns true. However every time i run the program, it says puzzle cannot be solved, even though a solution exist.
 
Ralph Cook
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid we're about to tell you the same thing -- that a solution cannot be found, even though a solution (undoubtably) exists.

We don't know what class puzzle is; we don't know what its methods do; we don't know what the Util static method does. We're good, but we cannot debug a small piece of a program, and since it would likely be a waste of time I'm not inclined to try.

I would say right off that you have a bigger problem. If your debugger in Eclipse is not working, you need to get that fixed. I'm sorry, but you cannot use mine with me operating it, even if you provide all the code.

rc
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ralph Cook wrote:I would say right off that you have a bigger problem. If your debugger in Eclipse is not working, you need to get that fixed. I'm sorry, but you cannot use mine with me operating it, even if you provide all the code.


And what's wrong with using system.out.print as your debugger? It may not be much, but it's a skill that all programmers should have -- as there will be cases where you will be caught without an IDE, especially if you go on-site a lot.

Henry
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!