raz / conform / run / Control.raz

42 lines · 1.0 KiB · raw · history · last change 1d7484fe

1module Control;
2import Out;
3
4proc main*;
5var i, j, n: I64; u: U8; k: I8;
6begin
7 for i := 1 to 5 do Out.int(i); end; Out.ln;
8 for i := 10 to 1 by -3 do Out.int(i); Out.str(" "); end; Out.ln;
9 for i := 0 to 10 by 4 do Out.int(i); Out.str(" "); end; Out.ln;
10 for i := 5 to 1 do Out.str("never"); end;
11 n := 0;
12 for u := 250 to 255 do n := n + 1; end;
13 Out.int(n); Out.ln;
14 n := 0;
15 for k := 120 to 127 by 3 do n := n + 1; end;
16 Out.int(n); Out.ln;
17 i := 0;
18 while i < 3 do
19 j := 0;
20 while true do
21 if j = 2 then break; end;
22 Out.int(i * 10 + j); Out.str(" ");
23 j := j + 1;
24 end;
25 i := i + 1;
26 end;
27 Out.ln;
28 i := 0;
29 repeat i := i + 1; if i = 4 then break; end; until i = 10;
30 Out.int(i); Out.ln;
31 for i := 1 to 4 do
32 if i = 1 then Out.str("one");
33 elsif i = 2 then Out.str("two");
34 elsif i = 3 then Out.str("three");
35 else Out.str("many");
36 end;
37 Out.str(" ");
38 end;
39 Out.ln;
40end;
41
42end Control.