Page 1 of 1

Problem 7− A mouse wants to find cheese in a 5×5 grid. The cheese is in random place in the maze. The mouse can make one

Posted: Thu Jul 14, 2022 2:07 pm
by answerhappygod
Problem 7 A Mouse Wants To Find Cheese In A 5 5 Grid The Cheese Is In Random Place In The Maze The Mouse Can Make One 1
Problem 7 A Mouse Wants To Find Cheese In A 5 5 Grid The Cheese Is In Random Place In The Maze The Mouse Can Make One 1 (311.98 KiB) Viewed 32 times
complete with Python
Problem 7− A mouse wants to find cheese in a 5×5 grid. The cheese is in random place in the maze. The mouse can make one of the moves to right, left, up or down. It continues moving until it finds the cheese. Write a function that gets the initial location of the mouse [x,y] as input and helps the mouse find the cheese by telling in if it's making the correct move each time until it finds the cheese. You type in the mouse move every time and tell the mouse if it's getting closer to the cheese or farther from it. Example: CheeseHunt ([1,2]) Please make a move: > right Closer to cheese Please make a move: > right Farther from cheese Please make a move: > left Closer to cheese Please make a move: > up Closer to cheese Please make a move: > up Closer to cheese Please make a move: > up Congratulations found cheese at : [2, 5]