Debian Codegraph @

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

raw
1 #include <tads.h>
2
3 randomPhoneNumber()
4 {
5 #if 1
6
7 return '555'
8 + makeString([1,1,1,1].mapAll({x: rand(10) + 48}));
9
10 #else
11
12 local n;
13 for (n = '555' ; n.length() < 7 ; )
14 n += toString(rand(10));
15 return n;
16
17 #endif
18 }
19
20 main(args)
21 {
22 for (local i = 0 ; i < 4 ; ++i)
23 "<<i>> = <<randomPhoneNumber()>>\n";
24 }