![]() Migrating with Egyptian scarabs in the shape of Imotep\'s uuuuuugly face.scared you away from the pearly gate ![]() Lock(gate) :- gate(locked) -> write('Unfortunately, a colossal swarm of Africanized bees That or you aren\'t even at the gate, don\'t have the key in your inventory, or you were so distracted that you didn\'t notice the gate was already unlocked.\n'), report at(you,gate), at(key,you), retract(gate(locked)), assert(gate(unlocked)), write('You have unlocked the pearly gate with your creepy key.\n'), report. Unlock(gate) :- gate(unlocked) -> write('Unfortunately, a colossal swarm of Africanized bees migrating with Egyptian scarabs in the shape of Imotep\'s uuuuuugly face.scared you away from the pearly gate momentarily. Check inventory with \'inventory\'.\n'), report. You can\'t take it twice bozo!\n'), report.ĭrop(key) :- at(you,Loc), at(key,you), not(Loc = you) -> retract(at(key,you)), assert(at(key,Loc)), write('You have dropped the key.\n'), report write('You don\'t have a key in your Take(key) :- write('I\'m sorry, but you already have the key. Retract(at(key,Loc)), assert(at(key,you)), write('You have swallowed the key.I mean taken it.\n'), report. Take(key) :- at(you,Loc), at(key,Loc), not(Loc = you), Or you are moving between any other locations viaĪ valid direction Dir, then travel to the newīut if the movement was not a legal direction, Oh, and you\'re dead.'), retract(at(you,gate)), assert(at(you,done)).īut if you are at the gate and the gate is unlocked, Report at(you,gate), connect(gate,Dir,_), gate(unlocked), at(key,you), write('ZAAAAAP! Poseidon\'s bolt got you in the bottom. You must have a key to open the gate.\n'), Then it alerts you, gives you a hint to unlock it,Īnd reports your location. If you are at the gate and the gate is locked, Prints the description of your updated location. Move(Dir) moves you in a direction Dir, then The meaning of connect(X,Dir,Y) is that if youĪre at X and you move in direction Dir, you These connect predicates establish the map. Report prints the description of your current 'You are right at a pearly white gate TO HEAVEN.'). ![]() 'You are in a maze of twisty trails, all alike.'). 'You are teetering on the edge of a cliff.'). 'You are on a path, with ravines on both sides.'). 'You are in a pleasant valley, with a trail ahead.'). Treasure without being killed first, but there willįirst, text descriptions of all places within the Six places: a valley, a path, a cliff, a fork, a maze,Ī gate, and a mountaintop. There are threeĮntities: you, a treasure, and an ogre. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |