: Facing in any direction and given enough turns, it can move from any square on the board to any other square. If you want to know the simplest way your knight can move from one square (or node) to another in a two-dimensional setup, you will first have to build a function like the one below. knight plays ([0,0], [1,2]) == [[0,0], [1,2]] knight plays ([0,0], [3,3]) == [[0,0], [1,2], [3,3]] knight plays ([3,3], [0,0]) == [[3,3], [1,2], [0,0]] You are required to do the following: 1. Explain how you can ensure that any move do not go off the board. 2. Choosing a search algorithm for finding the shortest path for the knight’s travails.3. Create a diagrammatical tree structure, to illustrate all possible moves of the knight as children in the tree structure. In this task, you need to understand two algorithms which can be helpful, the Breadth-First Search which utilizes the Queue data structure to find the shortest path and the Depth-First Search which can traverse a Stack data structures.
Comments
Leave a comment