Advertisement
logicmoo

Marties

Oct 8th, 2018
525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 6.15 KB | None | 0 0
  1.  
  2. % floyd @ somewhere: about to: examine(table)
  3. Time passes.
  4. [8: player1] ==> memory
  5. memory(player1)
  6. [ todo([]),
  7.   [time_passes],
  8.   model([ related(exit(north),garden,'<unexplored>',2),
  9.           related(in,screendoor,garden,2),
  10.           related(in,mushroom,garden,2),
  11.           related(in,rock,garden,2),
  12.           related(in,player1,garden,2),
  13.           related(exit(south),kitchen,garden,2),
  14.           related(exit(west),kitchen,'<unexplored>',1),
  15.           related(exit(east),kitchen,'<unexplored>',1),
  16.           related(exit(north),kitchen,'<unexplored>',1),
  17.           related(in,table,kitchen,1)
  18.         ]),
  19.   timestamp(8),
  20.   did(wait),
  21.   [time_passes],
  22.   timestamp(7),
  23.   did(wait),
  24.   [time_passes],
  25.   timestamp(6),
  26.   did(wait),
  27.   [time_passes],
  28.   timestamp(5),
  29.   did(wait),
  30.   [time_passes],
  31.   timestamp(4),
  32.   did(wait),
  33.   [failure(go(*,south)),'You can\'t go that way'],
  34.  timestamp(3),
  35.  did(go(*,south)),
  36.  [ moved(player1,kitchen,in,garden),
  37.    [cap(subj(player1)),person(go,goes),south]
  38.  ],
  39.  [ see(you_are(in,garden),
  40.        exits_are([north]),
  41.        here_are([player1,rock,mushroom,screendoor]))
  42.  ],
  43.  timestamp(2),
  44.  did(go(*,south)),
  45.  [ see(you_are(in,kitchen),
  46.        exits_are([north,south,east,west]),
  47.        here_are([player1,table,screendoor]))
  48.  ],
  49.  timestamp(1),
  50.  timestamp(0),
  51.  goals([]),
  52.  agent(player1),
  53.  inherit(console)
  54. ]
  55.  
  56. % floyd: see_props(table,[relatable(on),relatable(under)])
  57.  
  58. % floyd @ somewhere: about to: examine(screendoor)
  59. [9: player1] ==>
  60.  
  61. % floyd: see_props(screendoor,[can_be(move,f),door_to(garden),state(open,f)])
  62. Time passes.
  63. [10: player1] ==> memory floyd
  64. [ did(go(*,west)),
  65.  todo([]),
  66.  goals([]),
  67.  [ see_props(screendoor,
  68.              [can_be(move,f),door_to(garden),state(open,f)])
  69.  ],
  70.  [see_children(screendoor,'<unrelatable>',[])],
  71.  model([ props(screendoor,
  72.                [can_be(move,f),door_to(garden),state(open,f)],
  73.                9),
  74.          related(on,box,table,8),
  75.          related(on,lamp,table,8),
  76.          props(table,[relatable(on),relatable(under)],8),
  77.          related(exit(west),kitchen,'<unexplored>',7),
  78.          related(exit(east),kitchen,'<unexplored>',7),
  79.          related(exit(south),kitchen,'<unexplored>',7),
  80.          related(exit(north),kitchen,'<unexplored>',7),
  81.          related(in,screendoor,kitchen,7),
  82.          related(in,table,kitchen,7),
  83.          related(in,floyd,kitchen,7),
  84.          related(exit(south),pantry,kitchen,7),
  85.          related(exit(down),pantry,basement,6),
  86.          related(in,shelf,pantry,6),
  87.          related(exit(up),basement,pantry,6),
  88.          props(shovel,[],5),
  89.          related(in,shovel,basement,4),
  90.          props(shelf,[relatable(on),can_be(move,f)],3),
  91.          related(held_by,wrench,floyd,2),
  92.          props(floyd,
  93.                [ name('Floyd the robot'),
  94.                  inherit(floyd_ish),
  95.                  inherit(instance),
  96.                  inherit(character),
  97.                  inherit(autonomous),
  98.                  emits(light),
  99.                  volume(50),
  100.                  mass(200),
  101.                  nouns(robot),
  102.                  adjs(metallic),
  103.                  desc('Your classic robot: metallic with glowing red eyes, enthusiastic but not very clever.'),
  104.                  can_be(switch,t),
  105.                  state(powered,t),
  106.                  effect(switch(on),setprop($self,state(powered,t))),
  107.                  effect(switch(off),setprop($self,state(powered,f))),
  108.                  relatable(held_by),
  109.                  relatable(worn_by),
  110.                  volume(50),
  111.                  mass(50),
  112.                  can(eat)
  113.                ],
  114.                2)
  115.        ]),
  116.  timestamp(9),
  117.  did(examine(screendoor)),
  118.  [see_props(table,[relatable(on),relatable(under)])],
  119.  [see_children(table,on,[lamp,box])],
  120.  timestamp(8),
  121.  did(examine(table)),
  122.  [ moved(floyd,pantry,in,kitchen),
  123.    [cap(subj(floyd)),person(go,goes),south]
  124.  ],
  125.  [ see(you_are(in,kitchen),
  126.        exits_are([north,south,east,west]),
  127.        here_are([floyd,table,screendoor]))
  128.  ],
  129.  timestamp(7),
  130.  did(go(*,south)),
  131.  [ moved(floyd,basement,in,pantry),
  132.    [cap(subj(floyd)),person(go,goes),up]
  133.  ],
  134.  [ see(you_are(in,pantry),
  135.        exits_are([south,down]),
  136.        here_are([floyd,shelf]))
  137.  ],
  138.  timestamp(6),
  139.  did(go(*,up)),
  140.  [see_props(shovel,[])],
  141.  [see_children(shovel,'<unrelatable>',[])],
  142.  timestamp(5),
  143.  did(examine(shovel)),
  144.  [ moved(floyd,pantry,in,basement),
  145.    [cap(subj(floyd)),person(go,goes),down]
  146.  ],
  147.  [see(you_are(in,basement),exits_are([up]),here_are([floyd,shovel]))],
  148.  timestamp(4),
  149.  did(go(*,down)),
  150.  [see_props(shelf,[relatable(on),can_be(move,f)])],
  151.  [see_children(shelf,on,[])],
  152.  timestamp(3),
  153.  did(examine(shelf)),
  154.  [ see_props(floyd,
  155.              [ name('Floyd the robot'),
  156.                inherit(floyd_ish),
  157.                inherit(instance),
  158.                inherit(character),
  159.                inherit(autonomous),
  160.                emits(light),
  161.                volume(50),
  162.                mass(200),
  163.                nouns(robot),
  164.                adjs(metallic),
  165.                desc('Your classic robot: metallic with glowing red eyes, enthusiastic but not very clever.'),
  166.                can_be(switch,t),
  167.                state(powered,t),
  168.                effect(switch(on),setprop($self,state(powered,t))),
  169.                effect(switch(off),setprop($self,state(powered,f))),
  170.                relatable(held_by),
  171.                relatable(worn_by),
  172.                volume(50),
  173.                mass(50),
  174.                can(eat)
  175.              ])
  176.  ],
  177.  [see_children(floyd,held_by,[wrench])],
  178.  timestamp(2),
  179.  did(examine(floyd)),
  180.  [ see(you_are(in,pantry),
  181.        exits_are([south,down]),
  182.        here_are([floyd,shelf]))
  183.  ],
  184.  timestamp(1),
  185.  timestamp(0),
  186.  agent(floyd),
  187.  inherit(autonomous)
  188. ]
  189.  
  190. % floyd @ somewhere: about to: examine(videocamera)
  191. [11: player1] ==>
  192.  
  193. % floyd: see_props(videocamera,[inherit(recorder),can_be(switch,t),effect(switch(on),setprop($self,on)),effect(switch(off),delprop($self,on)                                 ),fragile(broken_videocam)])
  194. Time passes.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement