-
Notifications
You must be signed in to change notification settings - Fork 1
/
sample.txt
75 lines (51 loc) · 1.12 KB
/
sample.txt
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
from "extern.lts" import *
from std import math
namespace my_nspace
func someFunc() {
print("from someFunc")
}
someFunc()
func add(i1, i2) {
var temp = i1 + i2
return i1 + i2
}
add(96, 65)
add(-6, 85)
var str = "world"
var n =
1 * .2
+ "hello "
+ $"{str} !"
+ (8 - 9) / 2
+ math.PI
+ extern.MOTD.toString()
+ global.args[6 / 6 - 1]
+ extern.magicNumber.toString("x")
hey++
-- hello // yes, surprisingly, that is legal, and no, it is not a bug
n = -.1
foreach (item in collection) {
if (item != 0) continue;
hello.there(item);
}
foreach (item2 in some.class.arr) {
if (item2 == "am tired") break;
}
var a = --n
obj = new Object()
arr = [ 1, 5, -3, 8 ]
var b = true
for (var i = 0, i < arr.length, i++)
print(arr[i])
if (!arr.contains(5)) {
print("arr didn't contain the number five. Adding it back...")
arr.add(5)
}
var counter = 5;
while (counter > 0) counter--
if (a < 0) {
a = math.abs(a);
} else if (a == 0)
a = 100
else
a = math.pow(a, 2)