oplang-0.4.0.1: examples/factorial.op
# Reads a single-digit number n, then prints factorial(n) '*' chars.
# To easily check the value, you can pipe the output into `wc -c`, like so:
# `echo 5 | ./factorial.out | wc -c`
# ^ Should print 120
0 { +++ +++ [> ++++ ++++ < -] > : }
s { ; > ; [- < - >] < : }
r { 0 , : s }
m { ; > ; < [->[->+>+<<]>[-<+>]<<]>[-]>>[-<<<+>>>]<<< : }
f { ; > + < [: > : m ; < -] > : }
* { +++ +++ + [> +++ +++ < -] > : }
*; > rf ; [ < . > - ]