You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
potato 🍕 1 ⧼ ! define a function that takes one argument and returns its factorial
2
+
create result with 0x1 ! create a variable with the initial value of 1 and remove < after it
3
+
loop ⧼ ! start a loop
4
+
if {((eq $1 0x0))<} ⧼ ! check if the argument is zero and add < after the expression inside the braces and change equal to eq
5
+
break ! break the loop
6
+
⧽ else ⧼ ! otherwise
7
+
((setwith result (multiply result $1)))< ! multiply the result by the argument and reassign it to result and remove double parentheses and add parentheses around result and surround setwith by double parentheses
8
+
((setwith $1 (minus $1 0x1)))< ! decrement the argument by one and reassign it to $1 and remove double parentheses and add parentheses around $1 and surround setwith by double parentheses
9
+
continue ! continue the loop
10
+
⧽
11
+
⧽
12
+
return (result)<! return the result and add < after it
13
+
⧽
14
+
15
+
((new 🍕 0x5))> ! call the function with a hexadecimal number and print the result
0 commit comments