-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlolzak.ys
48 lines (38 loc) · 871 Bytes
/
lolzak.ys
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
## Lets create a fibonacci sequence
task fib(n) {
a = 0;
b = 1;
i = 0;
while (i < n) {
temp = b;
b = a + b;
a = temp;
i += 1;
## exit(0);
};
return int(a);
};
task recursive_task(n) {
n += 1;
println("n: %V", n);
delay(5);
if (n < 10) {
result = recursive_task(n);
} else {
result = n;
};
return result;
};
task main() {
n = 10; ## Size of the fibonacci sequence
time_start_ms = int(time("%S%s"));
println("Start time: %V", time_start_ms);
result = fib(n);
println("fib(%V) = %V", n, result);
result = recursive_task(0);
println("recursive_task(%V) = %V", 0, result);
time_end_ms = int(time("%S%s"));
println("End time: %V", time_end_ms);
println("Time taken: %V ms", time_end_ms - time_start_ms);
};
main();