git @ Cat's Eye Technologies NaNoGenMo-Entries-2018 / master league / Extraordinarily-Dull.samovar
master

Tree @master (Download .tar.gz)

Extraordinarily-Dull.samovar @masterraw · history · blame

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
//
// Samovar description for: The League of Extraordinarily Dull Gentlemen
// Submitted to NaNoGenMo 2018
// by Chris Pressey, Cat's Eye Technologies
//

// ------------------------ COMMON RULES ------------------------

scenario Rules {
  [actor(?A),item(?I),unheld(?I)]                   ?A picked up the ?I. [holding(?A,?I),!unheld(?I)]
  [actor(?A),item(?I),holding(?A,?I),!keeps(?A,?I)] ?A put down the ?I.  [!holding(?A,?I),unheld(?I)]

  [actor(?A),item(?I),holding(?A,?I),drink(?I),!allocated(?I)]      ?A took a sip of the ?I. [allocated(?I),allocated-to(?A,?I)]
  [actor(?A),item(?I),holding(?A,?I),drink(?I),allocated-to(?A,?I)] ?A took a sip of the ?I. [allocated(?I),allocated-to(?A,?I)]

  [actor(?A),item(?I),readable(?I),holding(?A,?I)] ?A read the ?I. [has-read(?A,?I)]

  [actor(?A),!sitting(?A),environs(?R)]       ?A walked around the ?R.   []
  [actor(?A),!sitting(?A),seat(?S),empty(?S)] ?A sat down on the ?S.     [sitting(?A),sitting-on(?A,?S),!empty(?S)]
  [actor(?A),sitting(?A),sitting-on(?A,?S)]   ?A leaned back in the ?S.  []
  [actor(?A),sitting(?A),sitting-on(?A,?S)]   ?A got up and stretched.   [!sitting(?A),!sitting-on(?A,?S),empty(?S)]

  [actor(?A)]  ?A coughed.  []
  [actor(?A)]  ?A rubbed his chin.  []
  [actor(?A) where ?A=Throgmorton]  ?A brushed some dust off his coat sleeve.  []
  [actor(?A) where ?A=Scurthorpe]   ?A adjusted his monocle.  []
  [actor(?A) where ?A=Pranehurst]   ?A wrinkled his nose.  []
  [actor(?A) where ?A=Furze-Platt]  ?A rubbed his wrist.  []

  [actor(?A),actor(?B)]  ?A looked at ?B.  []
  [actor(?A),actor(?B)]  ?A nodded to ?B.  []

  [actor(?A),fenestration(?P)]  ?A looked out the ?P.  []

  [actor(?A),!sitting(?A),prop(?P),!near(?A)]  ?A walked over to the ?P.    [near(?A),near-to(?A,?P)]
  [actor(?A),near-to(?A,?P)]                   ?A examined the ?P closely.  []
  [actor(?A),!sitting(?A),near-to(?A,?P)]      ?A walked away from the ?P.  [!near(?A),!near-to(?A,?P)]

  [prop(?P),!described(?P)]               Nearby there was a ?P.  [described(?P)]
  [prop(?P),!described(?P),environs(?R)]  In the corner of the ?R there was a ?P.  [described(?P)]

  [actor(?A),has-news(?A,?T),!exclaimed-has-news(?A,?T)]    ?A exclaimed, "I have news!"  [exclaimed-has-news(?A,?T)]
  [actor(?A),exclaimed-has-news(?B,?T),!heard-news(?A,?T)]  ?A asked, "What is it, ?B?"   [been-asked-about-news(?B,?T)]
  [actor(?A),been-asked-about-news(?A,?T),actor(?B)]        ?A told ?B of the ?T.         [heard-news(?B,?T)]
}

// ----------------------------- SETTINGS ------------------------

scenario SittingRoom {
    environs(sitting_room).

    prop(bookshelf).
    prop(window). fenestration(window).
    prop(fireplace).
    prop(grandfather_clock).
    prop(leather_chair). seat(leather_chair). empty(leather_chair).

    item(newspaper). readable(newspaper). unheld(newspaper).
    item(whiskey). drink(whiskey).  unheld(whiskey).
    item(brandy). drink(brandy).  unheld(brandy).
    item(pocket_watch). unheld(pocket_watch).
}

scenario Library {
    environs(library).

    prop(desk).
    prop(bookshelf).
    prop(window). fenestration(window).
    prop(leather_chair).  seat(leather_chair).  empty(leather_chair).
    prop(bust_of_Cicero).

    item(newspaper). readable(newspaper). unheld(newspaper).
    item(encyclopedia). readable(encyclopedia). unheld(encyclopedia).
    item(atlas). readable(atlas). unheld(atlas).
}

scenario GreatHall {
    environs(Great_Hall).

    prop(mantel).
    prop(leather_couch).
    prop(tapestry).
    prop(suit_of_armor).
    prop(French_window). fenestration(French_window).

    seat(leather_couch).
    empty(leather_couch).
}

scenario Conservatory {
    environs(conservatory).

    prop(grand_piano).
    prop(azalea).
    prop(bust_of_Beethoven).
    prop(skylight). fenestration(skylight).

    prop(leather_couch). seat(leather_couch). empty(leather_couch).
}

scenario GardenShed {
    environs(garden_shed).

    prop(workbench).
    prop(window). fenestration(window).
    prop(bags_of_potting_soil).

    seat(bags_of_potting_soil).
    empty(bags_of_potting_soil).

    item(oilcan). unheld(oilcan).
    item(hedge_trimmer). unheld(hedge_trimmer).
    item(screwdriver). unheld(screwdriver).
}

scenario WineCellar {
    environs(wine_cellar).

    prop(wine_rack).
    prop(cobwebs).
    prop(trunk_with_brass_fittings). seat(trunk_with_brass_fittings). empty(trunk_with_brass_fittings).
    prop(barrel).

    item(bottle_of_Beaujolais). unheld(bottle_of_Beaujolais).
    item(bottle_of_Sauvignon_blanc). unheld(bottle_of_Sauvignon_blanc).
    item(bottle_of_port). unheld(bottle_of_port).
}

scenario BilliardsRoom {
    environs(billiards_room).

    prop(billiards_table).
    prop(cue_rack).
    prop(ashtray_stand).
    prop(window). fenestration(window).
    prop(scoreboard).

    item(cue_chalk). unheld(cue_chalk).
}

scenario Riverside {
    environs(riverside).

    prop(boathouse). enterable(boathouse).
    prop(ancient_oak_tree).
    prop(bench). seat(bench). empty(bench).
    prop(dock).

    item(coil_of_rope). unheld(coil_of_rope).
    item(picnic_basket). unheld(picnic_basket).
}

scenario Kitchen {
    prop(stove).
    prop(oven).
    prop(sink).
    prop(pots_and_pans).
    prop(grimy_kitchen_window). fenestration(grimy_kitchen_window).

    item(empty_kettle). unheld(empty_kettle).
    item(empty_teapot). unheld(empty_teapot).
    item(empty_teacup). unheld(empty_teacup).
    item(tea_infuser). unheld(tea_infuser).
    item(cannister_of_tea). unheld(cannister_of_tea).
}

// ------------------------ SPECIFIC RULES ------------------------

scenario Searching {
    [actor(?A),actor(?B),looking-for(?B,?I),!looking-for(?A,?I)]
      "Why are we here, ?B?" asked ?A.
    [questioned-why(?A,?B,?I)]
    [actor(?A),actor(?B),questioned-why(?A,?B,?I)]
      "This is just where I would hide a ?I if I stole one, ?A!" replied ?B.
    [looking-for(?A,?I)]

    [actor(?A),looking-for(?A,?X),prop(?P)]            ?A looked behind the ?P.                   [looked-behind(?A,?P)]
    [actor(?A),looking-for(?A,?X),prop(?P)]            ?A bent down and looked under the ?P.      [looked-under(?A,?P)]
    [actor(?A),looking-for(?A,?X),item(?I),unheld(?I)] ?A lifted the ?I to see what was under it. [looked-under(?A,?I)]
}

scenario BadNews {
    [actor(?A),topic(?T),heard-news(?A,?T),bad-news(?T)] ?A was left shocked by the news of ?T. [shocked(?A)]

    [actor(?A),shocked(?A)]  ?A gasped.  []
    [actor(?A),shocked(?A)]  ?A stared blankly off into space.  []
    [actor(?A),shocked(?A)]  ?A winced.  []

    [actor(?A),shocked(?A)]  "I can't believe it," cried ?A.      [expressed-shock(?A)]
    [actor(?A),shocked(?A)]  "This is terrible!" cried ?A.        [expressed-shock(?A)]
    [actor(?A),shocked(?A)]  "I'm shocked!" cried ?A.             [expressed-shock(?A)]

}

scenario Moonlight {
    [prop(?P),fenestration(?P),prop(?Q),!lit-up(?Q)]
      Moonlight flooded in through the ?P and illuminated the ?Q.
    [lit-up(?Q)]
}

scenario Sunlight {
    [prop(?P),fenestration(?P),prop(?Q),!lit-up(?Q)]
      The morning sunlight streamed in through the ?P, lighting up the ?Q.
    [lit-up(?Q)]
}

scenario Theft {
    import Moonlight.
    [actor(?A),furtive(?A)] ?A cast a furtive glance around the room. [has-glanced(?A)]
    [actor(?A),has-glanced(?A)] ?A was now sure no one else was about. [confident(?A)]
    [actor(?A),confident(?A)] An owl hooted outside and ?A froze. [!confident(?A)]
    [actor(?A),!sitting(?A),prop(?P),near-to(?A,?P),fastened(?P),confident(?A)]
      ?A loosened the ?P from its fittings.
    [!fastened(?P),!prop(?P),item(?P),unheld(?P)]
    [actor(?A),confident(?A),item(?I),stealable(?I),holding(?A,?I)] ?A made off into the night. [!actor(?A),!item(?I)]
}

scenario LetterWriting {
    item(stationery). unheld(stationery).
    prop(inkwell_on_the_desk).
    item(quill_pen). unheld(quill_pen).

    [actor(?A),intent-to-write(?A,letter),holding(?A,quill_pen),near-to(?A,inkwell_on_the_desk)]
      ?A dipped the quill pen in the inkwell on the desk.
    [inky(quill_pen)]

    [actor(?A),intent-to-write(?A,letter),holding(?A,quill_pen),inky(quill_pen),holding(?A,stationery),!item(letter)]
      ?A penned a few thoughtful words on the stationery.
    [item(letter),holding(?A,letter)]
}

scenario ReceiveLetter {
    [!item(?I) where ?I=letter_from_old_Grisbourne]
      "Letter for you, Throgmorton," said Crumflatter, leaving as quicky as he appeared.
    [item(?I),unheld(?I),readable(?I)]

    [has-read(?A, ?I) where ?I=letter_from_old_Grisbourne]
      "It was good of him to write back," said ?A.
    [announce-has-read(?A, ?I)]
}

// ----------------------------- SCENES ------------------------

//
// Introduce characters: Throgmorton, Pranehurst, Scurthorpe, and Furze-Platt
//

scenario Scene_100_intro {
    import SittingRoom.
    import Rules.

    [actor(?A),actor(?B),!greeted(?A,?B)] "What ho, ?B!" exclaimed ?A.   [greeted(?A,?B)]
    [actor(?A),actor(?B),!greeted(?A,?B)] "Good afternoon, ?B," said ?A. [greeted(?A,?B)]

    actor(Pranehurst).
    actor(Scurthorpe).
    actor(Throgmorton).
    actor(Furze-Platt).

    [
        actor(Pranehurst),
        actor(Scurthorpe),
        actor(Throgmorton),
        actor(Furze-Platt),
        greeted(Pranehurst, Scurthorpe),
        greeted(Pranehurst, Throgmorton),
        greeted(Pranehurst, Furze-Platt),
        greeted(Scurthorpe, Pranehurst),
        greeted(Scurthorpe, Throgmorton),
        greeted(Scurthorpe, Furze-Platt),
        greeted(Throgmorton, Pranehurst),
        greeted(Throgmorton, Scurthorpe),
        greeted(Throgmorton, Furze-Platt),
        greeted(Furze-Platt, Pranehurst),
        greeted(Furze-Platt, Scurthorpe),
        greeted(Furze-Platt, Throgmorton)
    ]
      In short, it was an ordinary day at the Perivale Gentleman's Club.
    [
        greeted(all),
        // We revoke all the actors here to make the scene end immediately with this event (more or less).
        !actor(Pranehurst),
        !actor(Scurthorpe),
        !actor(Throgmorton),
        !actor(Furze-Platt)
    ]

    goal [greeted(all)].
}

//
// MacGuffin is stolen by a shadowy figure
//

scenario Scene_200_theft {
    import GreatHall.
    import Rules.
    import Theft.

    prop(silver_statuette_of_Artemis). stealable(silver_statuette_of_Artemis). fastened(silver_statuette_of_Artemis).
    actor(the_shadowy_figure). furtive(the_shadowy_figure).

    goal [!actor(the_shadowy_figure)].
}

//
// Characters are informed that MacGuffin is stolen
//

scenario Scene_300_oh_no {
    import SittingRoom.
    import Rules.
    import BadNews.

    actor(Pranehurst).
    actor(Scurthorpe).
    actor(Throgmorton).
    actor(Furze-Platt).

    topic(theft_of_the_statuette).
    has-news(Scurthorpe, theft_of_the_statuette). bad-news(theft_of_the_statuette).

    goal [expressed-shock(Throgmorton),expressed-shock(Pranehurst),expressed-shock(Furze-Platt)].
}

//
// Throgmorton writes a letter to Old Grisbourne asking them what they should do
//

scenario Scene_400_letter {
    import Library.
    import Rules.
    import LetterWriting.

    actor(Pranehurst).
    actor(Scurthorpe).
    actor(Throgmorton).
    actor(Furze-Platt).

    [!intent-to-write(?A,letter) where ?A=Throgmorton]
      "I shall write to Old Grisbourne. He will know just what to do," said ?A.
    [intent-to-write(?A,letter),keeps(?A,stationery),keeps(?A,quill_pen)]

    [item(?I),actor(?A),holding(?A,?I) where ?I=letter]
      "Now to send this at once!" chimed ?A.
    [announced-send(?I)]

    goal [announced-send(letter)].
}

//
// Pranehurst announces he has misplaced his umbrella
//

scenario Scene_500_brolly_lost {
    import SittingRoom.
    import Rules.

    actor(Pranehurst).
    actor(Scurthorpe).
    actor(Throgmorton).
    actor(Furze-Platt).

    topic(fact_that_he_misplaced_his_umbrella).
    has-news(Pranehurst, fact_that_he_misplaced_his_umbrella).

    [heard-news(?A, fact_that_he_misplaced_his_umbrella)]
      "That's a rotten shame, Pranehurst," said ?A.
    []

    goal [
        heard-news(Throgmorton, ?T),
        heard-news(Scurthorpe, ?T),
        heard-news(Furze-Platt, ?T)
        where ?T=fact_that_he_misplaced_his_umbrella
    ].
}

//
// A response to Throgmorton's letter arrives with questionable advice
//

scenario Scene_600_reply_letter {
    import SittingRoom.
    import Rules.
    import ReceiveLetter.

    actor(Pranehurst).
    actor(Scurthorpe).
    actor(Throgmorton).

    goal [announce-has-read(Throgmorton, letter_from_old_Grisbourne)].
}

scenario Scene_650_filler {
    import BilliardsRoom.

    import Rules.

    actor(Young_Froomhouse).
    actor(Young_Cumberforbe).

    turn(Young_Froomhouse).
    
    [actor(?A),turn(?A)]
      ?A squatted and surveyed the table.
    []

    [actor(?A),turn(?A)]
      ?A walked around the table, considering his shot.
    []

    [actor(?A),turn(?A)]
      ?A leaned over the table with his cue, preparing his shot.
    [preparing(?A)]

    [actor(?A),turn(?A),preparing(?A)]
      ?A hit the cue ball but it went wild and missed the red ball entirely.
    [!preparing(?A),took-turn(?A)]

    [actor(?A),turn(?A),preparing(?A)]
      ?A hit the cue ball into the red ball but it missed the pocket by an inch.
    [!preparing(?A),took-turn(?A)]

    [actor(?A),turn(?A),preparing(?A)]
      ?A hit the cue ball into the red ball and sank it in the corner pocket.
    [game-won-by(?A),!turn(?A)]

    [actor(?A),actor(?B),turn(?A),took-turn(?A)]
      "Your turn, ?B," said ?A.
    [!turn(?A),!took-turn(?A)]

    [actor(?A),actor(?B),game-won-by(?B)]
      "Good game, ?B," said ?A.
    [game-over(billiards)]

    [actor(?A),holding(?A,cue_chalk)]
      ?A chalked his cue.
    []

    other(Pranehurst).
    other(Scurthorpe).
    other(Throgmorton).
    other(Furze-Platt).

    topic(statuette_gone_missing).

    [actor(?A),topic(?T)] "Shame about that ?T," said ?A. [current-topic(?T)]

    [current-topic(statuette_gone_missing),actor(?A),other(?O),!proposed(?O)]
      "Do you think ?O could have taken it?" asked ?A.
    [proposed(?O)]
    [current-topic(statuette_gone_missing),actor(?A),other(?O),proposed(?O),!eliminated(?O)]
      "No, it couldn't have been ?O, he'd never do something like that," concluded ?A.
    [eliminated(?O)]

    goal [eliminated(Pranehurst),eliminated(Scurthorpe),eliminated(Throgmorton),eliminated(Furze-Platt),game-over(billiards)].
}

//
// Pranehurst and Scurthorpe look for the MacGuffin in the garden shed
//

scenario Scene_700_search_shed {
    import GardenShed.
    import Rules.
    import Searching.

    actor(Pranehurst).
    actor(Scurthorpe).

    looking-for(Scurthorpe, silver_statuette_of_Artemis).

    goal [looking-for(Pranehurst, silver_statuette_of_Artemis),sitting-on(Scurthorpe,bags_of_potting_soil)].
}

//
// Furze-Platt accuses Throgmorton of stealing the MacGuffin
//

scenario Scene_800_accuse {
    import SittingRoom.
    import Rules.

    [actor(?A),!calmer(?A),actor(?B),!accused(?B) where ?I=silver_statuette_of_Artemis]
      "I think YOU stole the ?I, ?B!" shouted ?A.
    [accused(?B),accused-by(?B,?A)]

    [accused(?A),!calmer(?A),!upset(?A)]
      "WHAT?" bellowed ?A.
    [upset(?A)]

    [upset(?B)] "Well I never!" bellowed ?B. []
    [upset(?B)] ?B spluttered. []
    [upset(?B)] "What rot!" bellowed ?B. []
    [upset(?B)] "Preposterous!" bellowed ?B. []

    actor(Furze-Platt).
    actor(Throgmorton).
    offstage(Crumflatter).
    calmer(Crumflatter).

    [upset(Furze-Platt),upset(Throgmorton),offstage(?A),environs(?R)]
      ?A walked into the ?R.
    [!offstage(?A),actor(?A)]

    [actor(?A),calmer(?A),actor(?B),upset(?B)]
      "Now, now, ?B, get ahold of yourself," said ?A.
    [!upset(?B)]

    [actor(Crumflatter),!upset(Furze-Platt),!upset(Throgmorton)]
      "That's better," said Crumflatter.
    []

    goal [actor(Crumflatter),!upset(Furze-Platt),!upset(Throgmorton)].
}

//
// Pranehurst and Scurthorpe look for the MacGuffin in the wine cellar and find a diary instead
//

scenario Scene_900_search_wine_cellar {
    import WineCellar.
    import Rules.
    import Searching.

    hidden(diary).

    [questioned-why(?A,?B,?X),looking-for(?A,?X),actor(?A),prop(?P),hidden(?I),!item(?I)]
      ?A looked under the ?P and found a ?I.
    [item(?I),unheld(?I),!hidden(?I)]

    [actor(?A),item(?I),holding(?A,?I),!found(?I) where ?I=diary]
      "Hello! What's this?" exclaimed ?A holding up the ?I.
    [found(?I),seen-by(?A,?I)]

    [actor(?A),item(?I),found(?I),holding(?A,?I),actor(?B)]
      ?A showed the ?I to ?B.
    [seen-by(?B,?I)]

    [actor(?A),item(?I),!holding(?A,?I),seen-by(?A,?I),actor(?B),seen-by(?B,?I) where ?I=diary]
      "Whose do you suppose it is, ?B?" asked ?A pointing at the diary.
    [questioned-whose(?A,diary)]

    actor(Pranehurst).
    actor(Scurthorpe).
    looking-for(Scurthorpe, silver_statuette_of_Artemis).

    goal [questioned-whose(Pranehurst, diary)].
}

//
// Pranehurst and Scurthorpe take the diary to the library and read it - it's Furze-Platt's
//

scenario Scene_1000_read_diary {
    import SittingRoom.
    import Rules.

    item(diary). readable(diary). juicy(diary).
    holding(Scurthorpe, diary).

    [actor(?A),item(?I),readable(?I),juicy(?I),holding(?A,?I),actor(?B)]
      "Listen to this, ?B!" said ?A as he related some of the contents of the ?I.
    [has-heard-from(?B,?I)]

    [actor(?A),item(?I),has-heard-from(?A,?I)]
      ?A was dumbstruck by what he heard from the ?I.
    [has-reacted-to(?A,?I)]

    actor(Pranehurst).
    actor(Scurthorpe).

    goal [has-read(Scurthorpe,diary),has-reacted-to(Scurthorpe,diary),
          has-read(Pranehurst,diary),has-reacted-to(Pranehurst,diary),
          holding(Pranehurst, diary)].
}

//
// Furze-Platt tries to make tea
//

scenario Scene_1100_tea {
    import Rules.
    import Kitchen.
    import Moonlight.

    actor(Furze-Platt).

    [near-to(?A,sink),holding(?A,empty_kettle)]
      ?A filled the kettle.
    [!item(empty_kettle),!holding(?A,empty_kettle),item(full_kettle),holding(?A,full_kettle)]

    [near-to(?A,stove),holding(?A,full_kettle)]
      ?A put the kettle on the stove.
    [!item(full_kettle),!holding(?A,full_kettle),prop(kettle_on_the_stove)]

    [prop(kettle_on_the_stove)]
      The kettle on the stove began to boil.
    [!prop(kettle_on_the_stove),item(boiling_kettle),unheld(boiling_kettle)]

    [actor(?A),holding(?A,empty_teapot),holding(?A,boiling_kettle)]
      ?A poured the boiling water into the teapot.
    [!item(empty_teapot),!holding(?A,empty_teapot),!item(boiling_kettle),!holding(?A,boiling_kettle),
     item(full_teapot),holding(?A,full_teapot)]

    [actor(?A),holding(?A,full_teapot),holding(?A,tea_infuser)]
      ?A dangled the tea infuser in the teapot and let it steep.
    [!item(full_teapot),!holding(?A,full_teapot),!item(tea_infuser),!holding(?A,tea_infuser),
     item(teapot_full_of_tea),holding(?A,teapot_full_of_tea)]

    [actor(?A),holding(?A,teapot_full_of_tea),holding(?A,empty_teacup)]
      ?A poured himself some tea.
    [!item(empty_teacup),!holding(?A,empty_teacup),
     item(cup_of_tea),holding(?A,cup_of_tea),drink(cup_of_tea),!actor(?A)]

    goal [holding(Furze-Platt,cup_of_tea)].
}

//
// Furze-platt overhears Pranehurst and Scurthorpe talking about the diary
//

scenario Scene_1200_overhear {
    import SittingRoom.
    import Rules.

    actor(Pranehurst).
    actor(Scurthorpe).
    offstage(Furze-Platt).

    [offstage(?A),actor(?B)] ?A stood in the shadows, unseen by ?B. [unseen-by(?A,?B)].
    [actor(?A),actor(?B),topic(?T)] ?A discussed ?T with ?B. [discussed(?T)].

    [offstage(?A),unseen-by(?A,Pranehurst),unseen-by(?A,Scurthorpe),discussed(?T)]
      ?A heard them talking about ?T.
    [alerted(?A,?T)].

    topic(what_to_do_with_the_diary).
    item(diary). holding(Scurthorpe, diary).

    goal [alerted(Furze-Platt,what_to_do_with_the_diary), holding(Scurthorpe,diary)].
}

//
// Scurthorpe hides the diary in the grand piano
//

scenario Scene_1300_hide_diary {
    import Conservatory.
    import Rules.

    item(diary). holding(Scurthorpe,diary). hideable(diary).

    container(grand_piano). open(grand_piano).

    [actor(?A),item(?I),hideable(?I),holding(?A,?I),prop(?P),container(?P),open(?P)]
      ?A hid the ?I in the ?P.
    [!item(?I),!holding(?A,?I),hidden_in(?I,?P)]

    actor(Scurthorpe).
    actor(Pranehurst).

    goal [hidden_in(diary,grand_piano)].
}

//
// Diary is stolen by a shadowy figure
//

scenario Scene_1400_diary_stolen {
    import Conservatory.
    import Rules.
    import Searching.
    import Theft.

    actor(the_shadowy_figure). furtive(the_shadowy_figure).
    looking-for(the_shadowy_figure, diary).

    [actor(?A),
     looked-under(?A,grand_piano),
     looked-under(?A,azalea),
     looked-under(?A,bust_of_Beethoven),
     looked-under(?A,leather_couch)]
      ?A began to look frustrated.
    [looked-everywhere(?A)]

    hidden(diary). stealable(diary).

    [actor(?A),looked-everywhere(?A),prop(?P),hidden(?I),!item(?I)]
      ?A looked inside the ?P and found a ?I.
    [item(?I),unheld(?I),!hidden(?I),!looked-everywhere(?A)]

    goal [!actor(the_shadowy_figure)].
}

//
// Scurthorpe and Pranehurst look for the diary the next morning but it is gone
//

scenario Scene_1500_diary_missing {
    import Conservatory.
    import Rules.
    import BadNews.
    import Sunlight.

    actor(Pranehurst).
    actor(Scurthorpe).

    offstage(Crumflatter).
    calmer(Crumflatter).

    topic(diary_has_been_taken). bad-news(diary_has_been_taken).

    [actor(?A),prop(?P),!looked-in(?P) where ?P=grand_piano]
      ?A looked in the ?P and gasped.
    [looked-in(?P),has-news(?A, diary_has_been_taken),heard-news(?A, diary_has_been_taken),shocked(?A)]

    [shocked(Scurthorpe),shocked(Pranehurst),offstage(?A),environs(?R)]
      ?A walked into the ?R.
    [!offstage(?A),actor(?A)]

    goal [shocked(Scurthorpe),shocked(Pranehurst),actor(Crumflatter)].
}

//
// Scurthorpe and Pranehurst invite Furze-Platt to go boating
//

scenario Scene_1600_lets_go_boating {
    import SittingRoom.
    import Rules.

    actor(Pranehurst).
    actor(Scurthorpe).
    actor(Throgmorton).
    actor(Furze-Platt).

    [!invited(Furze-Platt)]
      "Say, Furze-Platt, Scurthorpe and I are going boating tomorrow. Would you like to join us?"
    [invited-by(Furze-Platt, Scurthorpe)]

    [actor(?A),invited-by(?A,?B)]
      ?A considered the invitation.
    []

    [actor(?A),invited-by(?A,?B)]
      "Certainly, ?B! It sounds a right spot of fun," articulated ?A.
    [accepted-invitation(?A)]

    goal [accepted-invitation(Furze-Platt)].
}

//
// Pranehurst and Furze-Platt disappear inside the boathouse; when they emerge there is an understanding
//

scenario Scene_1700_boathouse {
    import Riverside.
    import Rules.

    [actor(?A),prop(?P),enterable(?P)] ?A went inside the ?P. [inside(?A,?P),!actor(?A)]
    [inside(?A,?P),!actor(?A)]         ?A came out of the ?P. [!inside(?A,?P),actor(?A)]

    [prop(?P),enterable(?P),inside(?A,?P),guilty(?A),inside(?B,?P),!guilty(?B)]
      The sound of voices could be heard from inside the ?P.
    [caught-out(?A),caught-out-by(?A,?B)]

    [actor(?A),actor(?B),caught-out-by(?A,?B)]
      ?A and ?B exchanged an ominous look.
    [received-ominous-look(?A)]

    actor(Pranehurst).
    actor(Scurthorpe).
    actor(Furze-Platt).
    guilty(Furze-Platt).

    goal [actor(Furze-Platt),received-ominous-look(Furze-Platt)].
}

//
// Throgmorton writes another letter to Old Grimsbourne asking them what they should do
//

scenario Scene_1800_another_letter {
    import Library.
    import Rules.
    import LetterWriting.

    actor(Pranehurst).
    actor(Scurthorpe).
    actor(Throgmorton).
    actor(Furze-Platt).

    [!intent-to-write(?A,letter) where ?A=Throgmorton]
      "I shall write to Old Grisbourne. He will know just what to do," said ?A.
    [intent-to-write(?A,letter),keeps(?A,stationery),keeps(?A,quill_pen)]

    [item(?I),actor(?A),holding(?A,?I) where ?I=letter]
      "Now to send this at once!" chimed ?A.
    [announced-send(?I)]

    goal [announced-send(letter)].
}

//
// Diary is burned by a shadowy figure who is revealed to be Furze-Platt
//

scenario Scene_1900_burn_diary {
    import SittingRoom.
    import Rules.

    container(fireplace). open(fireplace).
    item(matches). unheld(matches).
    item(iron_poker). unheld(iron_poker).

    actor(the_shadowy_figure). furtive(the_shadowy_figure).

    item(diary). holding(the_shadowy_figure, diary).

    [actor(?A),holding(?A,matches),!item(?I) where ?I=match]
      ?A lit a ?I.
    [item(?I),holding(?A,?I)]

    [actor(?A),item(?I),holding(?A,?I) where ?I=match]
      The ?I went out.
    [!item(?I),!holding(?A,?I)]

    [actor(?A),prop(?P),open(?P),!lit(?P),near-to(?A,?P),holding(?A,match)]
      ?A lit a fire in the ?P.
    [lit(?P)]

    [actor(?A),prop(?P),open(?P),near-to(?A,?P),holding(?A,?I) where ?I=diary]
      ?A put the ?I in the ?P.
    [!holding(?A,?I),hidden-in(?P,?I)]

    [item(?I),hidden-in(fireplace,?I),lit(fireplace) where ?I=diary]
      The fire reduced the ?I to ashes.
    [!item(?I),item(ashes)]

    [actor(?A),lit(?P),near-to(?A,?P),holding(?A,iron_poker),item(ashes) where ?P=fireplace]
      ?A poked the ashes with the poker.
    [!item(ashes),hidden-in(?P,ashes)]

    [actor(?A),hidden-in(fireplace,ashes),!revealed-to-be(the_shadowy_figure,Furze-Platt)]
      ?A stepped into the moonlight and the features of Furze-Platt were clearly visible.
    [revealed-to-be(the_shadowy_figure,Furze-Platt)]

    goal [revealed-to-be(the_shadowy_figure,Furze-Platt)].
}

//
// The next morning, the MacGuffin is returned
//

scenario Scene_2000_returned {
    import GreatHall.
    import Rules.

    actor(Pranehurst).
    actor(Scurthorpe).
    actor(Throgmorton).
    actor(Furze-Platt).

    prop(silver_statuette_of_Artemis).

    topic(return_of_the_statuette).
    has-news(Scurthorpe, return_of_the_statuette).

    goal [heard-news(Throgmorton, ?T),
          heard-news(Pranehurst, ?T),
          heard-news(Furze-Platt, ?T) where ?T=return_of_the_statuette].
}

//
// Throgmorton explains that he is suffering from somnambulism and kleptomania and that he found the MacGuffin in his nightstand
//

scenario Scene_2100_denoument {
    import SittingRoom.
    import Rules.
    import ReceiveLetter.

    actor(Pranehurst).
    actor(Scurthorpe).
    actor(Throgmorton).
    actor(Furze-Platt).

    [actor(Throgmorton) where ?I=statuette]
      "I found the ?I in my nightstand, you see," explained Throgmorton.
    [explained1(Throgmorton)]

    [actor(Throgmorton)]
      "My doctor says my somnambulism is improving daily!" chirped Throgmorton.
    [explained2(Throgmorton)]

    [actor(Throgmorton)]
      "My doctor is concerned I may be coming down with a touch of the kleptomania," warbled Throgmorton.
    [explained3(Throgmorton)]

    goal [
        announce-has-read(Throgmorton, letter_from_old_Grisbourne),
        explained1(Throgmorton),
        explained2(Throgmorton),
        explained3(Throgmorton)
    ].
}

//
// Pranehurst shows everyone his new umbrella
//

scenario Scene_2200_coda {
    import SittingRoom.
    import Rules.

    actor(Pranehurst).
    actor(Scurthorpe).
    actor(Throgmorton).
    actor(Furze-Platt).

    item(his_new_umbrella). holding(Pranehurst, his_new_umbrella).

    [actor(?A),holding(?A,?I),actor(?B)] ?A showed ?B the ?I. [has-been-showed(?B,?I)]

    goal [has-been-showed(Scurthorpe,his_new_umbrella),has-been-showed(Throgmorton,his_new_umbrella),
          has-been-showed(Furze-Platt,his_new_umbrella)].
}