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

Stats:

CreatedDec 6, 2015
PublishedDec 6, 2015
Warriors Trained976
Total Skips214
Total Code Submissions1995
Total Times Completed178
Python Completions125
JavaScript Completions59
Total Stars50
% of votes with a positive feedback rating95% of 74
Total "Very Satisfied" Votes68
Total "Somewhat Satisfied" Votes4
Total "Not Satisfied" Votes2
Total Rank Assessments6
Average Assessed Rank
4 kyu
Highest Assessed Rank
3 kyu
Lowest Assessed Rank
5 kyu
Ad
Contributors
  • emef Avatar
  • docgunthrop Avatar
  • Blind4Basics Avatar
  • Voile Avatar
  • Avanta Avatar
  • FArekkusu Avatar
Ad