File: fib.tig

package info (click to toggle)
frown 0.6.1-13
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 9,956 kB
  • sloc: haskell: 35,132; makefile: 228; csh: 35; yacc: 23
file content (12 lines) | stat: -rw-r--r-- 187 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
let
 function fib(n) =
  if n = 0 then 0
  else if n = 1 then 1
  else fib(n - 2) + fib(n - 1)
 var i := 0
in
 while i <= 42 do
  (print(showint(fib(i)));
   newline();
   i := i + 1)
end