capitalex hat die Gist bearbeitet . Zu Änderung gehen
2 files changed, 137 insertions
bottles.nv.wool(Datei erstellt)
@@ -0,0 +1,62 @@ | |||
1 | + | (keyword for 'if') say | |
2 | + | (keyword for 'else') otherwise-say | |
3 | + | ||
4 | + | 99 bottles of beer | |
5 | + | ||
6 | + | # $n bottles of beer | |
7 | + | $n bottles of beer on the wall! | |
8 | + | $n bottles of beer! | |
9 | + | You take one down, pass it around! | |
10 | + | when $n is 1, say | |
11 | + | No more bottles of beer on the wall! | |
12 | + | otherwise-say | |
13 | + | $n - 1 bottles of beer on the wall! | |
14 | + | $n - 1 bottles of beer | |
15 | + | end | |
16 | + | ||
17 | + | # 1 bottles of beer on the wall! | |
18 | + | print formatted (message) "1 bottle of beer on the wall!\n" | |
19 | + | ||
20 | + | # $n bottles of beer on the wall! | |
21 | + | print formatted | |
22 | + | (message) "{%d} bottles of beer on the wall!\n" | |
23 | + | (arguments) $n, _ | |
24 | + | ||
25 | + | # 1 bottles of beer! | |
26 | + | print formatted (message) "1 bottle of beer!\n" | |
27 | + | ||
28 | + | # $n bottles of beer! | |
29 | + | print formatted | |
30 | + | (message) "{%d} bottles of beer!\n" | |
31 | + | (arguments) $n, _ | |
32 | + | ||
33 | + | # You take one down, pass it around! | |
34 | + | print formatted | |
35 | + | (message) "You take one down, pass it around!\n" | |
36 | + | ||
37 | + | # when $n is $n | |
38 | + | ||
39 | + | # when $n is $m | |
40 | + | false | |
41 | + | ||
42 | + | # $_ - 1 bottles of beer on the wall! (@math) 1 | |
43 | + | print formatted | |
44 | + | (message) "1 bottle of beer on the wall!\n\n" | |
45 | + | ||
46 | + | # $_ - 1 bottles of beer on the wall! (@math) $n | |
47 | + | print formatted | |
48 | + | (message) "{%d} bottle of beer on the wall!\n\n" | |
49 | + | (arguments) $n, _ | |
50 | + | ||
51 | + | # $n - 1 bottles of beer on the wall!? | |
52 | + | (@math) subtract $n 1 | |
53 | + | ||
54 | + | # $_ - 1 bottles of beer (@math) $n | |
55 | + | $n bottles of beer | |
56 | + | ||
57 | + | # $n - 1 bottles of beer? | |
58 | + | (@math) subtract $n 1 | |
59 | + | ||
60 | + | # No more bottles of beer on the wall! | |
61 | + | print formatted | |
62 | + | (message) "No more bottles of beer on the wall!\n" |
parse.log(Datei erstellt)
@@ -0,0 +1,75 @@ | |||
1 | + | GIVE (keyword for 'if' [label]) (say [symbol]) | |
2 | + | GIVE (keyword for 'else' [label]) (otherwise-say [symbol]) | |
3 | + | GIVE (99 [symbol]) (bottles [symbol]) (of [symbol]) (beer [symbol]) | |
4 | + | RULE | |
5 | + | TAKE (n [var]) (bottles [symbol]) (of [symbol]) (beer [symbol]) | |
6 | + | GIVE (n [var]) (bottles [symbol]) (of [symbol]) (beer [symbol]) (on [symbol]) (the [symbol]) (wall! [symbol]) | |
7 | + | GIVE (n [var]) (bottles [symbol]) (of [symbol]) (beer! [symbol]) | |
8 | + | GIVE (You [symbol]) (take [symbol]) (one [symbol]) (down, [symbol]) (pass [symbol]) (it [symbol]) (around! [symbol]) | |
9 | + | GIVE (when [symbol]) (n [var]) (is [symbol]) (1, [symbol]) (say [symbol]) | |
10 | + | GIVE (No [symbol]) (more [symbol]) (bottles [symbol]) (of [symbol]) (beer [symbol]) (on [symbol]) (the [symbol]) (wall! [symbol]) | |
11 | + | GIVE (otherwise-say [symbol]) | |
12 | + | GIVE (n [var]) (- [symbol]) (1 [symbol]) (bottles [symbol]) (of [symbol]) (beer [symbol]) (on [symbol]) (the [symbol]) (wall! [symbol]) | |
13 | + | GIVE (n [var]) (- [symbol]) (1 [symbol]) (bottles [symbol]) (of [symbol]) (beer [symbol]) | |
14 | + | GIVE (end [symbol]) | |
15 | + | END | |
16 | + | RULE | |
17 | + | TAKE (1 [symbol]) (bottles [symbol]) (of [symbol]) (beer [symbol]) (on [symbol]) (the [symbol]) (wall! [symbol]) | |
18 | + | GIVE (print [symbol]) (formatted [symbol]) (message [label]) ("1 bottle of beer on the wall!\n" [string]) | |
19 | + | END | |
20 | + | RULE | |
21 | + | TAKE (n [var]) (bottles [symbol]) (of [symbol]) (beer [symbol]) (on [symbol]) (the [symbol]) (wall! [symbol]) | |
22 | + | GIVE (print [symbol]) (formatted [symbol]) ( [symbol]) | |
23 | + | GIVE (message [label]) ("{%d} bottles of beer on the wall!\n" [string]) | |
24 | + | GIVE (arguments [label]) (n, [var]) (_ [symbol]) | |
25 | + | END | |
26 | + | RULE | |
27 | + | TAKE (1 [symbol]) (bottles [symbol]) (of [symbol]) (beer! [symbol]) | |
28 | + | GIVE (print [symbol]) (formatted [symbol]) (message [label]) ("1 bottle of beer!\n" [string]) | |
29 | + | END | |
30 | + | RULE | |
31 | + | TAKE (n [var]) (bottles [symbol]) (of [symbol]) (beer! [symbol]) ( [symbol]) | |
32 | + | GIVE (print [symbol]) (formatted [symbol]) | |
33 | + | GIVE (message [label]) ("{%d} bottles of beer!\n" [string]) | |
34 | + | GIVE (arguments [label]) (n, [var]) (_ [symbol]) | |
35 | + | END | |
36 | + | RULE | |
37 | + | TAKE (You [symbol]) (take [symbol]) (one [symbol]) (down, [symbol]) (pass [symbol]) (it [symbol]) (around! [symbol]) ( [symbol]) | |
38 | + | GIVE (print [symbol]) (formatted [symbol]) | |
39 | + | GIVE (message [label]) ("You take one down, pass it around!\n" [string]) | |
40 | + | END | |
41 | + | RULE | |
42 | + | TAKE (when [symbol]) (n [var]) (is [symbol]) (n [var]) | |
43 | + | END | |
44 | + | RULE | |
45 | + | TAKE (when [symbol]) (n [var]) (is [symbol]) (m [var]) | |
46 | + | GIVE (false [symbol]) | |
47 | + | END | |
48 | + | RULE | |
49 | + | TAKE (_ [var]) (- [symbol]) (1 [symbol]) (bottles [symbol]) (of [symbol]) (beer [symbol]) (on [symbol]) (the [symbol]) (wall! [symbol]) (@math [label]) (1 [symbol]) | |
50 | + | GIVE (print [symbol]) (formatted [symbol]) | |
51 | + | GIVE (message [label]) ("1 bottle of beer on the wall!\n\n" [string]) | |
52 | + | END | |
53 | + | RULE | |
54 | + | TAKE (_ [var]) (- [symbol]) (1 [symbol]) (bottles [symbol]) (of [symbol]) (beer [symbol]) (on [symbol]) (the [symbol]) (wall! [symbol]) (@math [label]) (n [var]) | |
55 | + | GIVE (print [symbol]) (formatted [symbol]) | |
56 | + | GIVE (message [label]) ("{%d} bottle of beer on the wall!\n\n" [string]) | |
57 | + | GIVE (arguments [label]) (n, [var]) (_ [symbol]) | |
58 | + | END | |
59 | + | RULE | |
60 | + | TAKE (n [var]) (- [symbol]) (1 [symbol]) (bottles [symbol]) (of [symbol]) (beer [symbol]) (on [symbol]) (the [symbol]) (wall!? [symbol]) | |
61 | + | GIVE (@math [label]) (subtract [symbol]) (n [var]) (1 [symbol]) | |
62 | + | END | |
63 | + | RULE | |
64 | + | TAKE (_ [var]) (- [symbol]) (1 [symbol]) (bottles [symbol]) (of [symbol]) (beer [symbol]) (@math [label]) (n [var]) | |
65 | + | GIVE (n [var]) (bottles [symbol]) (of [symbol]) (beer [symbol]) | |
66 | + | END | |
67 | + | RULE | |
68 | + | TAKE (n [var]) (- [symbol]) (1 [symbol]) (bottles [symbol]) (of [symbol]) (beer? [symbol]) | |
69 | + | GIVE (@math [label]) (subtract [symbol]) (n [var]) (1 [symbol]) | |
70 | + | END | |
71 | + | RULE | |
72 | + | TAKE (No [symbol]) (more [symbol]) (bottles [symbol]) (of [symbol]) (beer [symbol]) (on [symbol]) (the [symbol]) (wall! [symbol]) | |
73 | + | GIVE (print [symbol]) (formatted [symbol]) | |
74 | + | GIVE (message [label]) ("No more bottles of beer on the wall!\n" [string]) | |
75 | + | END |
Neuer
Älter