Starting from:
$35

$29

Homework 7 Solution

Use TkInter to create an n n knights tour puzzle game. You can create a class and a function knights tour(n) that together launch an n n knight’s tour game.

For example, knights tour(5) will create an initial chessboard like


















Your program should check if a move made by the user is valid or not. Highlight all the positions that have been visited before in blue, and the currently occupied square should be shown in orange. Read the wiki page https://en.wikipedia.org/wiki/Knight%27s_tour to get more information on knight’s tour game. For simplicity, we assume that the knight is allowed to go back to positions that have been visited before. You are not required to do anything after the game ends (that is, when all the squares have been visited), but you are encouraged to make the game more interesting and user-friendly by including more features.

Name your script hw7.py and submit it on CCLE.

More products