File: fib2.ft

package info (click to toggle)
fudgit 2.42-6
  • links: PTS
  • area: non-free
  • in suites: potato, woody
  • size: 2,468 kB
  • ctags: 2,375
  • sloc: ansic: 27,729; makefile: 793; yacc: 724; lex: 102; asm: 29; fortran: 15
file content (18 lines) | stat: -rw-r--r-- 234 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Play safe
free @all
# Other versions to test procedures
cmode
	proc fib3(x) {
		for(a=0,b=1;b<x;c=b,b=b+a,a=c) {
			print b, "\n"
		}
	}
	proc fib2(x) {
		auto a,b,c

		for(a=0,b=1;b<x;c=b,b+=a,a=c) {
			print b, "\n"
		}
	}
fmode