Must be new solution! Using Lisp, implement a program that solves the Missionaries and Cannibals problem that uses a DFS( depth first search). The function call should use (mac start(this is the current state of the problem) end(this is the desired state)). So the problem should output sequences of moves to go from the start state to the desired state!       For example, the call should be like:       Call: (mac '(3 3 l) '(0 0 r))       Output: ((3 3 l) (2 2 r) (3 2 l) (3 0 r) (3 1 l) (1 1 r) (2 2 l) (0 2 r) (0 3 l) (0 1 r) (1 1 l) (0 0 r))   Please make sure this is able to be achieved using GNU Common Lisp!

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 8SA
icon
Related questions
Question

Must be new solution!

Using Lisp, implement a program that solves the Missionaries and Cannibals problem that uses a DFS( depth first search). The function call should use (mac start(this is the current state of the problem) end(this is the desired state)). So the problem should output sequences of moves to go from the start state to the desired state!

 

 

 

For example, the call should be like:

 

 

 

Call: (mac '(3 3 l) '(0 0 r))

 

 

 

Output: ((3 3 l) (2 2 r) (3 2 l) (3 0 r) (3 1 l) (1 1 r) (2 2 l) (0 2 r) (0 3 l) (0 1 r) (1 1 l) (0 0 r))

 

Please make sure this is able to be achieved using GNU Common Lisp!

 

 

 

AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning