aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0riginaln0 <74508026+0riginaln0@users.noreply.github.com>2024-04-14 07:43:20 +0300
committerLouis Pilfold <louis@lpil.uk>2024-04-15 13:10:48 +0100
commit589fca9fbab1825c21295afc5cdec9bf038fb48e (patch)
tree51205a75b621ff7d0d0d9390e60080dda38214ef
parente96f969c72a7106993a9e51eb781570520e41404 (diff)
downloadtour-589fca9fbab1825c21295afc5cdec9bf038fb48e.tar.gz
tour-589fca9fbab1825c21295afc5cdec9bf038fb48e.zip
separate case
-rw-r--r--src/content/chapter2_flow_control/lesson05_recursion/code.gleam3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/content/chapter2_flow_control/lesson05_recursion/code.gleam b/src/content/chapter2_flow_control/lesson05_recursion/code.gleam
index 4b24db1..10d45ab 100644
--- a/src/content/chapter2_flow_control/lesson05_recursion/code.gleam
+++ b/src/content/chapter2_flow_control/lesson05_recursion/code.gleam
@@ -9,7 +9,8 @@ pub fn main() {
pub fn factorial(x: Int) -> Int {
case x {
// Base case
- 0 | 1 -> 1
+ 0 -> 1
+ 1 -> 1
// Recursive case
_ -> x * factorial(x - 1)