Description Usage Arguments Value Examples
View source: R/01_Knights_Tour.R
Recursively search for a knight's tour on a NxN chess board. Currently returns no more than one solution. The knight begins on a corner square.
1 2 3 4 5 |
N |
The size of the NxN chess board. |
position |
A numeric vector of length 2 describing the coordinates of the proposed next position on a chess board. |
moves |
List of numeric vectors describing the valid moves a kight can make in a game of chess. |
solution |
Numeric NxN matrix describing the (possibly partial) knight's tour. |
last_move |
Numeric vector of length 2 describing the last move in the (possibly partial) knight's tour. |
pb |
Text progress bar to view progress in constructing a knight's tour. |
A NxN matrix describing a knight's tour if a solution exists.
Otherwise FALSE
.
1 | kt_solve_recursively(N = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.