Call functions
This commit is contained in:
19
tests/fib.grnd
Normal file
19
tests/fib.grnd
Normal file
@@ -0,0 +1,19 @@
|
||||
set &a 0
|
||||
set &b 1
|
||||
set &n 92
|
||||
|
||||
set &i 0
|
||||
@loop
|
||||
equal $i $n &done
|
||||
if $done %end
|
||||
|
||||
add $a $b &temp
|
||||
set &a $b
|
||||
set &b $temp
|
||||
|
||||
add $i 1 &i
|
||||
jump %loop
|
||||
|
||||
@end
|
||||
println "Fibonacci result:" $a
|
||||
end
|
||||
Reference in New Issue
Block a user