(* The Great Win32 Language Shootout http://dada.perl.it/shootout/

   contributed by Isaac Gouy (Modula2 novice)

   To build: xc =m fibo
   To run:     fibo 32
*)

MODULE Fibo;

(* Prefer qualified procedures *)
IMPORT STextIO, SWholeIO, LanguageShootout;


PROCEDURE Fibo (n: CARDINAL) : CARDINAL;
BEGIN
   IF n<2 THEN
      RETURN 1;
   ELSE
      RETURN Fibo(n-2) + Fibo(n-1);
   END;
END Fibo;


BEGIN
  SWholeIO.WriteCard( Fibo( LanguageShootout.N() ),1);
  STextIO.WriteLn;
END Fibo.