repo.or.cz
/
voodoo-lang.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Report number of passed and failed tests
[voodoo-lang.git]
/
test
/
fact.voo
blob
fc0423dbd789cc2112adfea3f22613f56c787b54
1
#### Factorial in Voodoo
2
3
section data
4
5
format:
6
string "%d\n\x00"
7
8
section functions
9
import printf
10
export main
11
12
fact:
13
function n
14
ifle n 0
15
return 1
16
end if
17
let m sub n 1
18
set m call fact m
19
return mul n m
20
end function
21
22
main:
23
function argc argv
24
let n call fact 12
25
call printf format n
26
return 0
27
end function