Lab 4: Monkeys and Bananas
- In the Spring 2003 exam, I gave a question about monkeys and
- Today you're going to make the monkey go from the start to
get and eat the bananas
- First using assertions make a door from the start to room 1.
- Give the monkey a fact that states his position.
- Make a rule which moves him.
- (If you did this right, you might find the monkey moving from
start to room1 and back repeatedly. Stop this by using
the Execuction+Halt menu item.)
- Add the extra rooms and doors in, and make the monkey move to
- Now add in the bananas and the crate.
- Have the monkey move to the crate, then move it. (I found it
necessary to use (test (neq ?new ?old)) in the LHS of this rule.
neq means that ?new is not equal to ?old.
- Now write rules to make him climb on the crate, grab the
bananas, and eat them. (3 rules should do)
- Now run from scratch.
- Add a rule to let the monkey get off the barrel.
- Can you add more barrels, bananas and doors to make
it more interesting?