Debian Codegraph @

terps/tads/tads3/test/data/oneof.t

raw
1 #include <tads.h>
2
3 main(args)
4 {
5 local s;
6 local a = 123, b = 456, c = 789;
7
8 for (local i in 1..50)
9 {
10 s = 'The random mood is <<one of>>happy<<or>>sad<<or>>morose<<
11 or>>elated<<or>>excited<<or>>melancholy<<or>>thrilled<<
12 or>>confused<<or>>curious<<or>>indifferent<<or>>middling<<
13 then shuffled>>. ';
14 "<<s>>\n";
15 }
16
17 "\b";
18 for (local i in 1..50)
19 {
20 s = '''Let's pick a variable to show: <<one of>>a=<<a>><<
21 or>>b=<<b>><<or>>c=<<c>><<then at random>>.''';
22 "<<s>>\n";
23 }
24
25 "\b";
26 for (local i in 1..50)
27 {
28 "Cycling through colors to <<one of>>red<<or>>blue<<or>>green<<
29 or>>yellow<<or>>orange<<or>>purple<<or>>magenta<<or>>cyan<<
30 or>>gold<<cycling>>.\n";
31 }
32
33 "\b";
34 for (local i in 1..50)
35 {
36 "Randomly picking variables again: <<one of>>a = <<a>><<
37 or>>b = <<b>><<or>>c = <<c>><<purely at random>>.\n";
38 }
39
40 "\b";
41 for (local i in 1..50)
42 {
43 "Nested if &gt; oneof [<<i>>]: <<if i < 25>><<
44 one of>>red<<or>>blue<<or>>green<<at random>><<else
45 >><<one of>>yellow<<or>>orange<<or>>purple<<at random>><<
46 end>>\n";
47 }
48
49 "\b";
50 for (local i in 1..50)
51 {
52 "Nested oneof &gt; if [<<i>>]: <<one of
53 >><<if i < 25>>red<<else>>yellow<<or
54 >><<if i < 25>>blue<<else>>orange<<or
55 >><<if i < 25>>green<<else>>purple<<at random>>\n";
56 }
57
58 "\b";
59 for (local i in 1..5)
60 "First time only [<<i>>] <<first time>>- here it is!<<only>>...\n";
61 }