The dragon


next up previous
Next: Prolog is not logic
Up: An Adventure world (PPPE)
Previous: The Wumpus
Back: to main list of student notes

The dragon

Now, I said nothing about the dragon in the last exercise. Let's suppose that it's more deadly than the wumpus, because it can shoot flame from one cave to another - but it can't shoot further than that. Can you translate into Prolog, ``the player (fred) will be burnt alive if he is in a cave that is next to the one the dragon is in''. Start with

will_be_burnt_alive( fred ) :-

Test your answer by moving the player and dragon to various caves, and asking

will_be_burnt_alive( fred ).

You may have a problem to do with unidirectionality (I won't say more than that because it may let the game out of the bag). When you think you have tested your new fact adequately, and you are either satisfied, or you have got something wrong and can't see how to continue, please go to the next section. But try this one first.


next up previous
Next: Prolog is not logic
Up: An Adventure world (PPPE)
Previous: The Wumpus
Back: to main list of student notes



Jocelyn Paine
Tue Jun 4 17:55:54 BST 1996