+ 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.

28th Nov 2017, 3:58 PM
Ore
Ore - avatar
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"
28th Nov 2017, 4:03 PM
Ore
Ore - avatar
5th Dec 2017, 8:44 AM
LukArToDo
LukArToDo - avatar
+ 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
18th Jan 2018, 9:42 PM
Jamil Mameri
Jamil Mameri - avatar
+ 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
18th Jan 2018, 9:44 PM
Jamil Mameri
Jamil Mameri - avatar