Knight's tour

FCC link

Knight's Tour Problem: You have an empty w * h chessboard, but for a single knight on some square. The knight must perform a sequence of legal moves that result in the knight visiting every square on the chessboard exactly once. Note that it is not a requirement that the tour be "closed"; that is, the knight need not end within a single move of its start position.

Test

{{test}}

Console output