Skip to content

Commit ab9ab5c

Browse files
committed
Fixing old code to reflect new proper syntax for factorial function.
1 parent a589cd0 commit ab9ab5c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,10 @@ Program below prints the factorial of 5, which will output `120` after iterating
236236
```funktion
237237
`5..1` t1t
238238
239-
factorial(x) = x * factorial(x).step()
239+
factorial(x) = ? x > 1 => x * factorial(x - 1) : 1
240240
241-
print(factorial(x):1)
241+
factorial(x).step(5)
242+
print(x:5)
242243
```
243244

244245
**Output:**

index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,10 @@ <h3>Factorial - (factorial.funk)</h3>
446446
<p>Program below prints the factorial of 5, which will output <code>120</code> after iterating through each product. This is created using a method that outputs the answer using a recursive algorithm.</p>
447447
<pre><code>`5..1` t1t
448448

449-
factorial(x) = x * factorial(x).step()
449+
factorial(x) = ? x > 1 => x * factorial(x - 1) : 1
450450

451-
print(factorial(x):1)</code></pre>
451+
factorial(x).step(5)
452+
print(x:5)</code></pre>
452453
<div class="output">
453454
<div class="output-title">Output:</div>
454455
<pre>5

0 commit comments

Comments
 (0)