Question
WRITE A PROLOG PROGRAM =================================================== Write, execute, and test a Prolog program to simulate a mouse traversing a maze. DESCRIPTION Use a predicate d/2 to
WRITE A PROLOG PROGRAM
===================================================
Write, execute, and test a Prolog program to simulate a mouse traversing a maze.
DESCRIPTION
Use a predicate d/2 to specify the doors between rooms of the maze, e.g., d(a,b) means that there is a door linking rooms a and b. Assume that the mouse always starts in the room named enter, and that the room named exit has the only door out of the maze, although room exit may also have doors leading to other rooms.
WHAT TO DO: Show all solutions and screenshots for the mouse running the maze in each test case. Use the following 5 test cases: (A) d(enter,b). d(b,c). d(b,e). d(d,e). d(c,d). d(e,f). d(e,exit). (B) d(enter,e). d(b,c). d(b,e). d(d,e). d(c,d). d(e,f). d(f,exit). (C) d(enter,e). d(b,c). d(d,e). d(c,d). d(e,f). d(g,e). (D) d(enter,e). d(b,c). d(d,e). d(c,d). d(e,f). d(c,exit). (E) d(enter,a). d(a,exit).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started