+ 8
[ASSIGNMENT] : The Knight Tour Challenge.
Write a program in any language of your choice that moves a knight on a chess board. The knight must touch all 64 squares once and only once. You don't have to care about the visualisation. Just let it print "Position: 4". Something like that. A knight can move in L-shapes, two boxes in one side and one in the other. e.g two vertically and one horizontally. Hint: Make an array called "horizontal" to store possible horizontal moves and vertical to store corresponding possible vertical moves.
4 Answers
+ 2
Possible moves
H V
1 2
1 -2
2 1
2 -1
-1 2
-2 1
-2 -1
-1 -2
Hint: Declare variables currentRow, currentColumn, moveNumber, a Boolean double-subscripted array called "visited", an int double-subscripted array called "board"
+ 1
Great problem to resolve, thanks for the chellenge.
This is my try with display of result on list NxN
https://code.sololearn.com/c70IteAYD0la/#py
+ 1
Here same problem with visual graphic display with Turtle.
Don't run here but it can be try it on your installation
https://code.sololearn.com/cEC078rfFEOp/#py