summaryrefslogtreecommitdiff
path: root/examples/fib.ash
blob: c29476d9eb9e5ad85620925b7af0ecd63fd06750 (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 !lim
	var a 1 !a
	var b 1 !b
	@lim while dup 0 > do
		@a dump
		@b dup
		@a
		+ !b
		!a
		1 -
	done
end

10 fib