?? demo4.th
字號:
( compute factorial recursively )( take x as input, return x! and x as output ): fact-help dup if 1 - ( leave x-1 on top ) fact-help ( leave x-1, [x-1]! ) 1 + ( leave x, [x-1]!, x ) swap over swap ( leave [x-1]!, x, x ) * ( into x!, x ) swap ( into x, x! ) else 1 swap then;: fact fact-help drop;: demo4 " 4 factorial is: " 4 fact . cr " 6 factorial is: " 6 fact . cr;demo4
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -