So it would be like, if stack is a b
OP_1
; so right now the stack is a b c, with c=1
;--
OP_1 OP_PICK
; a b c b
OP_0 OP_EQUAL
; a b c (b==0)
OP_IF
OP_DUP OP_RETURN ; wtf ???? scrypt.studio is burning my top stack when I op_return within an OP_IF
OP_ELSE
; a b c
OP_2 OP_PICK
; a b c a
OP_MUL
; a b (c*a)
OP_1 OP_PICK
; a b (c*a) b
OP_1SUB
; a b (c*a) (b-1)
OP_ROT OP_ROT
; a (b-1) b (c*a)
OP_NIP
; a (b-1) (c*a)
OP_ENDIF
;--
Copy that 10 times..
Could be better (fast exponentiation, b>0 is not us

[more]