Reference no: EM133424137
Question: Consider a maze, where a robot must navigate to reach the exit. The robot can move up, down, left, or right, and does not need to turn. In racket these can be symbolic atoms. In Haskell they can be integers or a custom algebraic data type. A maze is represented by a list of lists. Each nested list represents a row. Each element of the row is a number.
• A zero (0) represents an empty space,
• A one (1) represents a wall,
• A two (2) represents the starting cell,
• A three (3) represents the exit.
You will need to implement a function that takes maze, and a list of moves and yields whether or not the robot exits the maze. This is not a simple boolean value as there must also be an error state. An error occurs whenever the starting cell is not specified. In racket you can use an atom to represent an error. In Haskell you should use the Maybe data type. You can use Nothing to represent an error, Just True to represent success, and Just False to represent failure. When a move would cause the robot to enter a space with a wall, simply ignore the move. Alternatively, you may yield an error like you would do when the starting cell is missing. Implement the function in scheme (racket).