/
everything.kaos
75 lines (62 loc) · 1.14 KB
/
everything.kaos
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
/*
This is a test that almost every feature of the language
used in a program altogether to see if anything is wrong.
*/
import modules.lib
from modules.lib import everything_f2
import modules.lib as lib2
/*
This is a
multiline comment
for the function below
@description Adds to numbers together
*/
num def add(num x, num y)
num z = x + y
bool a = true
num b = 576.34
// This is a comment
list c = ['foo', "bar", 17, 3.14, a, false] // End of Line(EOL) comment
pretty echo c
# This is a comment too
dict d = {'a': 1, 'b': b, 'c': [2, 3, 4]} # End of Line(EOL) comment
pretty print d
del c
end {
z == 8 : f1(),
z > 10 : f2(),
default : f3()
}
print add(3, 5)
echo lib.everything_f1(4)
print everything_f2(32)
print lib2.everything_f3(121, 34)
num def f1()
num a = 101
return a
end
num def f2()
num b = 102
return b
end
num def f3()
num c = 103
return c
end
list a = [
1,
2,
3
]
foreach a as el
print el
el = 5
2 times do
print el
end
end
dict n = {'a': 'foo', 'b': 'bar', 'c': 'baz'}
foreach n as key : val
print key
print val
end