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 on

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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 on

Post 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 On 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 On 1 (93.74 KiB) Viewed 32 times
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]
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply