-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.kr
89 lines (72 loc) · 2.21 KB
/
sample.kr
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
let add @int = fn(x @int, y @int){
return x + y;
};
let sub @int = fn(x @int, y @int){
return x - y;
};
let mul @int = fn(x @int, y @int){
return x * y;
};
let div @int = fn(x @int, y @int){
return x * y;
};
let mod @int = fn(x @int, y @int){
return x % y;
};
let greater @bool = fn(x @int, y @int){
return x > y;
};
let greater_or_eq @bool = fn(x @int, y @int){
return x >= y;
};
let less @bool = fn(x @int, y @int){
return x < y;
};
let less_or_eq @bool = fn(x @int, y @int){
return x <= y;
};
let or @bool = fn(x @int, y @int){
return x || y;
};
let and @bool = fn(x @int, y @int){
return x && y;
};
@main fn(){
let x @int = 10;
let y @int = 20;
let name @string = "Karis";
let list1 [ @string ] = [ "ka", "ris" , "karis" ];
let list2 [ @int ] = [ 1, 2 , 3, 100, 1001 ];
let list3 [ @bool ] = [ true, false , false, true ];
let result0 @int = add(x,y);
let result1 @int = sub(x,y);
let result2 @int = mul(x,y);
let result3 @int = div(x,y);
let result4 @int = mod(x,y);
let result5 @bool = greater(y,x);
let result6 @bool = greater_or_eq(y,x);
let result7 @bool = less(x,y);
let result8 @bool = less_or_eq(y,x);
let result9 @bool = or(x,y);
let result10 @bool = and(y,x);
let result11 @bool = and(x,x);
print(x);
print(y);
print(name);
print(list1);
print(list2);
print(list3);
print(result0);
print(result1);
print(result2);
print(result3);
print(result4);
print("")
print(result5);
print(result6);
print(result7);
print(result8);
print(result9);
print(result10);
print(result11);
}@end;