- 1
Why isn't my code properly working
The below code is my attempt at the Knights tour problem. (Explanation of the problem is in the code. Also note that Knights can only make L shaped moves). The original code worked fine and only printed out one answer. But I then modified it so that it starts searching for an answer from every position of the board. My aim was that it will print out all possible answers. But once it finds the first answer, the program prints it and stops instead of printing all solutions. And after printing "an answer was found", it goes on to print " no answer was found". If solve returns 1, then we have an answer, So I also don't know why it prints "an answer was found" and "no answer was found". https://code.sololearn.com/ckEEC3ypee5L/?ref=app
1 Answer
+ 1
probably errors, there are some questions that need fixing in sololearn