summaryrefslogtreecommitdiff
path: root/examples/fib.ash
blob: bf2b90d6114e12d0bf0260d171929a453ba18463 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Print out given number of elements in the Fibonacci sequence, 46 is the max value
define fib
	var lim push lim
	var a 1 push a
	var b 1 push b
	pull lim while dup 0 > do
		pull a dump
		pull b dup
		pull a
		+ push b
		push a
		1 -
	done
end

10 fib