Hello everyone, I'm having a bit of an issue here. I'm doing a Knight's Tour program for class, and thought I just about had it until this problem popped up.
While I was writing my code, I had some simple cout test statements after some of the function calls just to be able to mark my progress as I went along. Later, my program finally was displaying the proper filled solution arrays, with the test statements in between. When I went to get rid of these statements, the program no longer worked properly.
//find next possible moves; cnt = next_valid_cells(cc, nc); cout << "TEST" << endl; //find the best move out of all these valid moves bestndx = bestmove(nc, cnt);
I narrowed it down to the above "TEST" statement I used between these two function calls. When I run the program with the statement there like above, it works...but with "TEST" between all the solution arrays 60 or so times depending on the particular solution its testing. When I comment it out, the program hangs and doesn't do anything.
I don't understand why I can't just remove that cout statement, which would leave my program running just right. I've never had a problem like this before, so I thought I'd come to the pros. Any help would be appreciated.