aboutsummaryrefslogtreecommitdiff
path: root/tests/src/fib.nim
blob: 34d38f0a4677cb5d2ac4e17df2bf6d1f1e4fae03 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
# fake nim

func fib(x): int -> int =
  if eq(x, 0):
    0
  else:
    if eq(x, 1):
      1
    else:       # comment
      add(fib(sub(x, 1)), fib(sub(x, 2)))

negate(negate(1))
fib(5)