home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
DRACO
/
DRACO-1.ARK
/
FIB.DRC
< prev
next >
Wrap
Text File
|
1986-11-12
|
512b
|
24 lines
int NTIMES = 10, /* number of times to compute Fibonacci value */
NUMBER = 24; /* biggest one we can compute with 16 bits */
proc fib(word x)word:
if x > 2 then
fib(x - 1) + fib(x - 2)
else
1
fi
corp;
proc main()void:
word i, value;
writeln(NTIMES, " iterations.");
for i from 1 upto NTIMES do
value := fib(NUMBER);
od;
writeln("Fibonacci(", NUMBER, ") = ", value, ".");
corp;