Groups
Groups
Sign in
Groups
Groups
符式協會
Conversations
About
Send feedback
Help
WebASM for Froth
28 views
Skip to first unread message
燕南
unread,
Jul 28, 2018, 5:00:57 PM
7/28/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to 符式協會
WebASM for Froth
https://el-tramo.be/blog/waforth/
https://github.com/remko/waforth
C
int factorial(int n) {
if (n == 0)
return 1;
else
return n * factorial(n-1);
}
WebASM \ Forth
get_local 0 \ local_0
i64.const 0 \ 0
i64.eq \ =
if i64 \ if
i64.const 1 \ 1
else \ else
get_local 0 \ local_0
get_local 0 \ local_0
i64.const 1 \ 1
i64.sub \ -
call 0 \ ( 遞迴呼叫 )
i64.mul \ *
end \ then
Reply all
Reply to author
Forward
0 new messages