\ calculate factorial by creating a stack of all numbers between n and \ 1, then multiply every element of that stack together. \ \ this uses only tail-position call/if, so the call stack never grows \ past the initial function call. \ \ this is not meant to be efficient, just exercise parts of the system \ and be something nice to look at with blinken : count-to ( n -- n n-1 ... 1 ) dup 1 > if dup 1 - count-to then ; : stack-mul ( n-x ... n x -- v ) dup 1 > if rot rot * swap 1 - stack-mul else drop then ; 5 count-to 5 stack-mul drop