-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTastierProgram.TAS
More file actions
45 lines (40 loc) · 1.02 KB
/
TastierProgram.TAS
File metadata and controls
45 lines (40 loc) · 1.02 KB
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
program Test {
const int limit = 1024;
int i;
struct test{
int age;
int height;
bool fresh;
};
void Test() {
int j, sum, g;
bool k;
struct test mytest;
struct test anotherTest;
//limit := 10; error, cannot re-assign constant
j := limit;
j++;
j--;
mytest.age := 6;
anotherTest.age := 21;
mytest.age := 10;
mytest.height := 20;
for(j:=0; j<limit; j++;){
i++;
}
// errors
/*/ <= insert asterix between the two slashes to get rid of all purposely placed errors
k++; // not integer type
mytest.boolean := 9; // not bool type
mytest.i := true; // different types
notAStruct.hello := 10; // notAStruct not declared
anotherTest.boolean := true; // not declared
for(p:=0; p<10; p++) // p undeclared
if (p%2==0)
q++;
//-----------------------------------------------------------------*/
}
void main() {
Test();
}
}