-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComplexTest.gml
More file actions
54 lines (45 loc) · 861 Bytes
/
ComplexTest.gml
File metadata and controls
54 lines (45 loc) · 861 Bytes
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
// Test various expressions and statements
var x = 10;
var y = 5;
// Test arithmetic and assignment
x += y;
y -= 2;
x *= 2;
y /= 3;
// Test bitwise operations
var a = 15;
var b = 7;
var c = a & b;
var d = a | b;
var e = a ^ b;
var f = ~a;
// Test increment/decrement
var i = 0;
++i;
i++;
--i;
i--;
// Test ternary operator
var max = x > y ? x : y;
// Test comparison and logical operations
var isEqual = x == y;
var isNotEqual = x != y;
var isGreater = x > y;
var both = isEqual && isNotEqual;
var either = isEqual || isNotEqual;
function test_loops() {
// Test while loop
var count = 0;
while (count < 3) {
count = count + 1;
}
// Test repeat loop
repeat (3) {
count = count + 1;
}
// Test for loop
for (var j = 0; j < 5; j = j + 1) {
count = count + 1;
}
return count;
}