-
Notifications
You must be signed in to change notification settings - Fork 0
/
TastierProgram.TAS
executable file
·76 lines (66 loc) · 1.22 KB
/
TastierProgram.TAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// A program to to show the use of constants, arrays
// and switch statements
program Test {
int i;
int j;
int n;
const int xy;
array int zzz[3];
array int xyz[6];
array int yyy[4][4];
struct a {
int b;
bool c;
}
struct check{
}
void set(){
i := 22;
}
void main(){
new a pic;
pic.b := 2;
xy = 3;
i := .pic.b;
write "pic.b := ";
writeln i;
write "Constant xy = ";
writeln xy;
zzz[2] := 82;
i := zzz[2];
writeln i;
zzz[0] := 88;
i := zzz[0];
write "[0]zzz = ";
writeln i;
yyy[2][2] := 77;
i := yyy[2][2];
write "yyy[2][2] = ";
writeln i;
i := 2;
switch(i):
case(1)
j := 1;
continue
case(2)
j := 2;
continue
case(3)
j := 3;
break
case(4)
j := 4;
break
default
j := 10;
write "j = ";
writeln j;
for(n := 0; n < 3; n := n + 1;){
j := j + 3;
}
write "n = ";
writeln n;
write "j = ";
writeln j;
}
}