Ruby implementation of the Knight's Tour