Knight's Tour (Wiki) with Backtracking in p5.js Check out the tour with Warnsdorf's heuristic - Here.
P.S. This might take a while to complete the tour.