Ask your own question, for FREE!
Computer Science 20 Online
OpenStudy (anonymous):

Suppose that you are given a chess board with n x n fields. A knight is set at position (x,y). Write a program that draws the path of n^2-1 moves, such that the knight visits each field exactly once. The knight moves in a ‘L’ fashion, meaning that it can do two moves and then turn in both x and y direction. Input description: You will be given an integer n (4<=n<=6) and two integers x and y (1<=x,y<=n) representing the coordinates of the position where the knight starts. Note: The coordinates of the knight start from 1 to n with (1,1) being the upper left corner of the matrix.

OpenStudy (anonymous):

which language?

OpenStudy (anonymous):

c++

OpenStudy (anonymous):

Its the knight's tour problem.. refer http://www.geeksforgeeks.org/backtracking-set-1-the-knights-tour-problem/

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!