-
Notifications
You must be signed in to change notification settings - Fork 0
/
vmc
71 lines (68 loc) · 951 Bytes
/
vmc
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
SUBROUTINE compute (firstParam1,secondParam1)
{
VAR x = 4%3;
RETURN x;
}
SUBROUTINE computeNew9 (firstParam2,secondParam2)
{
VAR x = 4%3;
RETURN x;
}
SUBROUTINE compute (firstParam3,secondParam3)
{
IFELSE(x>3)
{
VAR x = 4+5;
VAR x = 4+5;
}
ELSE
{
VAR y = 0-1000;
WHILE(((5)) > (y*4))
{
IF(y<3)
{VAR y = y+100;}
}
IFELSE(x>3)
{
VAR x = 4+5;
}
ELSE
{
VAR x = 4+5+3;
}
VAR z = isEnemyInRange (x);
}
RETURN x;
}
#This is a nonsensical program designed to show off subroutine calls and various control structures.
MAIN
{
WHILE(1==1)
{
VAR x = 0;
VAR x = x-100;
WHILE(x<3)
{
VAR x = 4+5;
}
IFELSE(x>3)
{
VAR x = 4+5;
}
ELSE
{
VAR x = 4+5+3;
}
VAR x = 4+5;
VAR x = 4+5;
VAR x = 4/3/2/1;
VAR x = (4+x)/(y*4+3);
VAR storage = CALL compute (y,z);
VAR z = isEnemyInRange (x);
IF(z==1)
{
selfDestruct();
}
}
}