mirror of
https://github.com/bobbimanners/EightBall.git
synced 2024-11-01 00:05:14 +00:00
e02674d8da
- New keyword `const` - `const` values are supported as array dimensions and variable.array initializers - Refactored code and saved several 100 bytes - Compiler generates better VM code for array allocation
18 lines
293 B
Plaintext
18 lines
293 B
Plaintext
'
|
|
' Recursive factorial function test
|
|
'
|
|
|
|
pr.dec fact(5); pr.nl
|
|
end
|
|
|
|
sub fact(word val)
|
|
pr.msg "fact("; pr.dec val; pr.msg ")"; pr.nl
|
|
if val == 0
|
|
return 1
|
|
else
|
|
return val * fact(val-1) ; ' THIS DOES NOT WORK
|
|
' return fact(val-1) * val ; ' BUT THIS DOES!!!
|
|
endif
|
|
endsub
|
|
|