aboutsummaryrefslogtreecommitdiff
path: root/examples/example.imp
blob: c60caa35b4f228a8896443774bc5e0f23dc01f47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* computes the n-th fibonacci number */

fib := 0;
fibnext := 1;
n := 5;

while n # 0 do
  var tmp := fibnext in
    fibnext := fib + fibnext;
    fib := tmp;
  end;
  n := n - 1;
end;