Question: Python programming language required A beast is in a labyrinth, which is represented as a rectangular grid. At any moment, the beast is at one
Python programming language required





A beast is in a labyrinth, which is represented as a rectangular grid. At any moment, the beast is at one particular position and is turned in one of four possible directions (up, down, left and right). In each round the beast makes one move: it will either turn left, turn right or take one step forward. At the beginning, the beast will always have a wall to its right. As the beast moves it tries to follow this wall at all times (see the sample output below). Standard input will contain an integer N on its own line, followed by a map of the labyrinth. Individual characters depict individual positions: 'x' is a wall and'.' is an empty spot. The characters '', '>', 'v' and 'X XXXXX XXXXX X...X X..^x XXXXX XXXXX X..^X X... XXXXX XXXXX X..
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
