4 kyu
A Knight's Tour
125 of 178emef
Description:
A Knight's Tour
A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square only once.
https://en.wikipedia.org/wiki/Knight%27s_tour
Traditional chess boards are 8x8 grids, but for this kata we are interested in generating tours for any square board sizes.
You will be asked to find a knight's path for any NxN board from any start position.
I have provided a tool to visualize the output of your code at the following link: http://jsfiddle.net/7sbyya59/2/
EDIT: The expected output is a 2D array (n x 2)
comprised of the [x,y]
coordinates of the Knight's path taken in sequential order. (e.g. [[2,3],[4,4],...,[x,y]]
)
All test cases will have a passing solution.
-dg
Algorithms
Similar Kata:
Stats:
Created | Dec 6, 2015 |
Published | Dec 6, 2015 |
Warriors Trained | 976 |
Total Skips | 214 |
Total Code Submissions | 1995 |
Total Times Completed | 178 |
Python Completions | 125 |
JavaScript Completions | 59 |
Total Stars | 50 |
% of votes with a positive feedback rating | 95% of 74 |
Total "Very Satisfied" Votes | 68 |
Total "Somewhat Satisfied" Votes | 4 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 6 |
Average Assessed Rank | 4 kyu |
Highest Assessed Rank | 3 kyu |
Lowest Assessed Rank | 5 kyu |