Befunge-93, 20 19 bytes
&+#v:!_:
\@#<*_\:.#
Reposting more of my answers from the old challenge that didn't fit the requirements. This one didn't get up to 125!
, at least with this interpreter.
Explanation:
& Get the input
+ Add it to the current counter (initially 0)
:!_ Duplicate and check if it is zero
&+ : If not, duplicate and repeat, but add the -1 from EOF to the input
#v:! If it is, not the 0 into a 1, duplicate and go to the second line
This initialises the stack as n,n-1,n-2...,1,1,1
< Start going left
\ _ : Check if the second element on the stack is zero
* If not, then multiply the top two elements
@# \ .# If it is, then print the factorial value and terminate
\ _ : Check if the second element on the stack is zero * If not, then multiply the top two elements @# \ .# If it is, then print the factorial value and terminate
I believe this was actually my first answer on this site, with the below being the 20 byte version of the above.
Befunge-93, 20 bytes
1&0>-#1:__\#0:#*_$.@