eval.in

Paste #1473

Slash — Slash HEAD, pasted 4 years ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
<%

def fib(n) {
  [a, b] = [0, 1];
  for i in 1..n {
    [a, b] = [b + a, a];
  }
  a;
}

print(fib(30));

Program Output

832040

OK (0.004 sec real, 0.002 sec wall, 4 MB, 10 syscalls)

Fork