git @ Cat's Eye Technologies Samovar / f013e74
Develop the demo novel a bit. Chris Pressey 6 years ago
6 changed file(s) with 71 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
7171 * (+) Consider what it would take to add a predicate that evaluates to whether
7272 a given action has been taken previously or not.
7373 * (+) Consider macros.
74 * Digits and -'s in atoms.
7475 * Output scenarios to JSON.
7576 * Python 3 support.
7677 * Allow comments in source file. Probably `#` or `//`.
0 events.txt
1 novel.md
11
22 for line in sys.stdin:
33 l = line.strip()
4 l = l.replace('_', ' ')
45 if l:
56 sys.stdout.write("{} ".format(l))
67 else:
00 #!/bin/sh
11
2 samovar settings.samovar scenes.samovar --min-events=12 | python formatter.py
2 THIS_SCRIPT=`realpath $0`
3 cd `dirname $THIS_SCRIPT`
4 samovar settings.samovar scenes.samovar --seed=0 --min-events=40 > events.txt
5 python formatter.py < events.txt > novel.md
6 cat novel.md
7 wc -w novel.md
8
0 scenario Actors {
1 [actor(α),item(β),~holding(α,β)] α picks up the β. [holding(α,β)]
2 [actor(α),item(β),holding(α,β)] α puts down the β. [~holding(α,β)]
3 actor(Ignatz).
4 actor(Molly).
0 scenario Rules {
1 [actor(?A),item(?I),unheld(?I)] ?A picked up the ?I. [holding(?A,?I),!unheld(?I)]
2 [actor(?A),item(?I),holding(?A,?I)] ?A put down the ?I. [holding(?A,?I),unheld(?I)]
3
4 [actor(?A),!sitting(?A)] ?A walked around the room. []
5 [actor(?A),!sitting(?A),seat(?S),empty(?S)] ?A sat down on the ?S. [sitting(?A),sitting_on(?A,?S),!empty(?S)]
6 [actor(?A),sitting(?A),sitting_on(?A,?S)] ?A leaned back in the ?S. []
7 [actor(?A),sitting(?A),sitting_on(?A,?S)] ?A got up and stretched. [!sitting(?A),!sitting_on(?A,?S),empty(?S)]
58 }
69
7 scenario ChapterI {
8 import Brickyard.
9 import Actors.
10 scenario SceneOne {
11 import SittingRoom.
12 import Rules.
13
14 actor(Pranehurst).
15 actor(Scurthorpe).
16 actor(Throgmorton).
17
18 shocked(Throgmorton).
1019
1120 goal [].
1221 }
1322
14 scenario ChapterII {
15 import DiningRoom.
16 import Actors.
23 scenario SceneTwo {
24 import GardenShed.
25 import Rules.
26
27 actor(Pranehurst).
28 actor(Scurthorpe).
29 actor(Throgmorton).
30
31 shocked(Throgmorton).
1732
1833 goal [].
1934 }
0 scenario Brickyard {
1 item(brick).
2 item(glass).
0 scenario SittingRoom {
1 prop(desk).
2 prop(bookshelf).
3 prop(window).
4 prop(grandfather_clock).
5 prop(leather_chair).
6
7 seat(leather_chair).
8 empty(leather_chair).
9
10 item(newspaper).
11 item(whiskey).
12 item(brandy).
13 item(pocket_watch).
14
15 unheld(newspaper).
16 unheld(whiskey).
17 unheld(brandy).
18 unheld(pcoket_watch).
319 }
420
5 scenario DiningRoom {
6 item(table).
7 item(chair).
21 scenario GardenShed {
22 prop(workbench).
23 prop(window).
24 prop(bags_of_potting_soil).
25
26 seat(bags_of_potting_soil).
27 empty(bags_of_potting_soil).
28
29 item(oilcan).
30 item(wrench).
31 item(screwdriver).
32
33 unheld(oilcan).
34 unheld(wrench).
35 unheld(screwdriver).
836 }