Need help with the Knight Tour problem

I'm new to programming and could use some help. I need help getting started on this. I'm lost on how to start approaching this. I have some idea but if someone could point me at the right direction I will grandly appreciate it.

"Write a C++ program that will
use the Stack and/or Queue to search for a unique path
for a chess knight to visit each and every chess board square
while visiting each square only once.

Assume that the knight doing the traversal is the knight
on the Queen side of the White pieces.
8 1
7 \ / 2
\ | /
-K-
/ | \
6 / \ 3
5 4
Hints:
You can save 7 untried positions for each new move the knight makes.
You can continue moving and storing the moved-to position in an 8x8 square array and storing
the sequence of valid moves in a ValidMovesStack that will model which chess board positions
the knight has already visited. "
Well, first you will have to figure out how it works on a chess board.
I'm not even sure it's possible but if it is, you should be able to google it.

Since you know the starting position, I would number each square on the chess board and keep up if it's visited already or not, and the order so you can go backwards when you hit a dead end.

Then it's just a matter of trying every square. keep up with the results so you don't try the same pattern twice and your off.
Topic archived. No new replies allowed.