CSD 3939 Home Page The Prior Page The Next Page
Middlesex Logo

Lab 4: Missionaries and Cannibals

  1. Remember the problem; there are 3 missionaries and 3 cannibals on one side of the river. They have a canoe that seats at most 2, and they need to get the other side of the river. If the cannibals ever outnumber the missionaries on either side of the river they eat them, and you lose.
  2. Make a java system that has the position of the cannibals, missionaries and boat.
  3. Make an interface that allows the user to choose how many missionaries and cannibals to move.
  4. Make the checks that the system works, with failure if the cannibals eat the missionaries.
  5. Now add depth first search.
  6. Have the system propose all the options from the start state.
  7. Print out the state as you go.
  8. Have it explore each in turn.
  9. You can use randomness.
  10. Fix to avoid backtracking.
  11. Print out the correct solution.
  12. Print out the full reachable state space.