;; factorial ;; inspired by the example in LDPL SET %result, 1 ; default SET %var0, 0 PUTV @argv, %var0, %n EQ %n, 0, $a JIF while PRINT "🦕 Enter a number: " ACCEPT %n while: SET $y, 0 GT %n, $y, $a JIF end_while MUL %n, %result, %result SET $y, 1 SUB %n, $y, %n JUMP while end_while: PRINT "Factorial: " PRINL %result EXIT