19 sun> prolog Welcome to SWI-Prolog (Multi-threaded, Version 5.6.22) Copyright (c) 1990-2006 University of Amsterdam. SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Please visit http://www.swi-prolog.org for details. For help, use ?- help(Topic). or ?- apropos(Word). ?- consult(agent). Warning: (/user/ioerger/course/wumpus.pl:51): Singleton variables: [S] ... % wumpus compiled 0.01 sec, 22,088 bytes % agent compiled 0.01 sec, 25,344 bytes Yes ?- reset. Yes ?- show. . . . . A . . P . . P . U . G . . . . . . . . . . . . . W . . . . . . . breeze facing north score 0 OK Yes ?- do(turn(left)). . . . . A . . P . . P . U . G . . . . . . . . . . . . . W . . . . . . . breeze facing west score -1 OK Yes ?- do([forward,forward,turn(left),forward,forward]). . . . A . . . P . . P . U . G . . . . . . . . . . . . . W . . . . . . . facing west score -2 OK . . A . . . . P . . P . U . G . . . . . . . . . . . . . W . . . . . . . facing west score -3 OK . . A . . . . P . . P . U . G . . . . . . . . . . . . . W . . . . . . . facing south score -4 OK . . . . . . . P A . P . U . G . . . . . . . . . . . . . W . . . . . . . breeze facing south score -5 OK . . . . . . . P . . P . U . A . . . . . . . . . . . . . W . . . . . . . glitter facing south score -6 OK Yes ?- do(pickup(gold)). . . . . . . . P . . P . U . A . . . . . . . . . . . . . W . . . . . . . glitter holding gold facing south score 94 OK Yes ?- do([turn(right),forward,forward,pickup(gun)]). . . . . . . . P . . P . U . A . . . . . . . . . . . . . W . . . . . . . glitter holding gold facing west score 93 OK . . . . . . . P . . P . U A . . . . . . . . . . . . . . W . . . . . . . breeze glitter holding gold facing west score 92 OK . . . . . . . P . . P . A . . . . . . . . . . . . . . . W . . . . . . . glitter holding gold see gun facing west score 91 OK . . . . . . . P . . P . A . . . . . . . . . . . . . . . W . . . . . . . glitter holding gun holding gold see gun facing west score 90 OK Yes ?- do([turn(left),forward,foward]). . . . . . . . P . . P . A . . . . . . . . . . . . . . . W . . . . . . . glitter holding gun holding gold see gun facing south score 89 OK . . . . . . . P . . P . . . . . . . A . . . . . . . . . W . . . . . . . glitter holding gun holding gold see gun facing south score 88 OK . . . . . . . P . . P . . . . . . . A . . . . . . . . . W . . . . . . . glitter holding gun holding gold see gun facing south score 87 OK Yes ?- do([forward,turn(left)]). . . . . . . . P . . P . . . . . . . . . . . . . A . . . W . . . . . . . glitter holding gun holding gold see gun facing south score 86 OK . . . . . . . P . . P . . . . . . . . . . . . . A . . . W . . . . . . . glitter holding gun holding gold see gun facing east score 85 OK Yes ?- do([forward,forward,forward]). . . . . . . . P . . P . . . . . . . . . . . . . . A . . W . . . . . . . glitter holding gun holding gold see gun facing east score 84 OK . . . . . . . P . . P . . . . . . . . . . . . . . . A . W . . . . . . . glitter holding gun holding gold see gun facing east score 83 OK . . . . . . . P . . P . . . . . . . . . . . . . . . . A W . . . . . . . stench glitter holding gun holding gold see gun facing east score 82 OK Yes ?- do(shoot). . . . . . . . P . . P . . . . . . . . . . . . . . . . A W . . . . . . . stench glitter scream holding gun holding gold see gun facing east score 182 OK Yes ?- do(turn(left)). . . . . . . . P . . P . . . . . . . . . . . . . . . . A W . . . . . . . stench glitter holding gun holding gold see gun facing north score 181 OK Yes ?- do([forward,forward,forward]). . . . . . . . P . . P . . . . . . . . . . A . . . . . . W . . . . . . . glitter holding gun holding gold see gun facing north score 180 OK . . . . . . . P . . P . . . . A . . . . . . . . . . . . W . . . . . . . glitter holding gun holding gold see gun facing north score 179 OK . . . . . . . P . A P . . . . . . . . . . . . . . . . . W . . . . . . . breeze glitter holding gun holding gold see gun facing north score 178 OK Yes ?- do([turn(right),forward,forward]). . . . . . . . P . A P . . . . . . . . . . . . . . . . . W . . . . . . . breeze glitter holding gun holding gold see gun facing east score 177 OK . . . . . . . P . . A . . . . . . . . . . . . . . . . . W . . . . . . . glitter holding gun holding gold see gun facing east score -1000 OK . . . . . . . P . . P A . . . . . . . . . . . . . . . . W . . . . . . . breeze glitter holding gun holding gold see gun facing east score -1000 OK Yes ?- halt. 20 sun>