Your questions made me go back and re-check over and over till I figured it out. I ended one of the loops to test if the board size is equal to getCol(), then return; and worked!
Thank you for...
Type: Posts; User: VallisMar
Your questions made me go back and re-check over and over till I figured it out. I ended one of the loops to test if the board size is equal to getCol(), then return; and worked!
Thank you for...
I rechecked, that does not have to be there. I deleted that chunk of code, still same issue.
It is supposed to check until no further solutions are found, then exit, not start all over.
Thank you for responding by the way!
I added print statements throughout the method. Right after the r--;//This is making it loop infinitely, before temp=board.pop(); print statement is in the...
sorry about the messy code!
It's supposed to exit once it it finds all the solutions for the board size (bSize), which is called in the main method.
For example, if we give the board a size of 4,...
Hello everyone,
New here. I am working on the N-Queen program and encountered a problem. The method below works and produces solutions, but it runs infinitely! Can someone take a look and see if...