📈 Examples
❗Factorial Example
This program calculates the factorial of number. In this case 5. The factorial of 5 is 120.
><//> Factorial Example
><number> ≈ ><{({°> ~
><factorial> ≈ ><(({°> ~
🌀 [><number> o~ ><(({°>]
><>
><factorial> ≈ ><factorial> ♡ ><number> ~
<number><< ~
<><
(+o ><factorial> ~
Let's break it down:
><number> ≈ ><{({°> ~
- Declare the number to calculate the factorial of. (5 in this case)><factorial> ≈ ><(({°> ~
- Declare the factorial variable. (1 in this case)🌀 [><number> o~ ><(({°>]
- While the number is greater than 1, do the following:><factorial> ≈ ><factorial> ♡ ><number> ~
- Multiply the factorial by the number.<number><< ~
- Decrement the number.- Repeat until the number is 1.
(+o ><factorial> ~
- Output the factorial.