最終更新 1752276654

bottles.nv.wool Raw Playground
1(keyword for 'if') say
2(keyword for 'else') otherwise-say
3
499 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 Raw Playground
1GIVE (keyword for 'if' [label]) (say [symbol])
2GIVE (keyword for 'else' [label]) (otherwise-say [symbol])
3GIVE (99 [symbol]) (bottles [symbol]) (of [symbol]) (beer [symbol])
4RULE
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])
15END
16RULE
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])
19END
20RULE
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])
25END
26RULE
27 TAKE (1 [symbol]) (bottles [symbol]) (of [symbol]) (beer! [symbol])
28 GIVE (print [symbol]) (formatted [symbol]) (message [label]) ("1 bottle of beer!\n" [string])
29END
30RULE
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])
35END
36RULE
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])
40END
41RULE
42 TAKE (when [symbol]) (n [var]) (is [symbol]) (n [var])
43END
44RULE
45 TAKE (when [symbol]) (n [var]) (is [symbol]) (m [var])
46 GIVE (false [symbol])
47END
48RULE
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])
52END
53RULE
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])
58END
59RULE
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])
62END
63RULE
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])
66END
67RULE
68 TAKE (n [var]) (- [symbol]) (1 [symbol]) (bottles [symbol]) (of [symbol]) (beer? [symbol])
69 GIVE (@math [label]) (subtract [symbol]) (n [var]) (1 [symbol])
70END
71RULE
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])
75END