diff options
Diffstat (limited to 'TUTORIAL.md')
-rw-r--r-- | TUTORIAL.md | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/TUTORIAL.md b/TUTORIAL.md index 30e7d62..ba6b8a1 100644 --- a/TUTORIAL.md +++ b/TUTORIAL.md @@ -424,7 +424,19 @@ language. The solutions can be found in the `solutions` folder under the project root. -Exercise 1: Running code +Exercise 1: Collatz conjecture step +----------------------------------- + +Given an integer `x`, compute the next step of the sequence +famous from the Collatz conjecture. In other words, if `x` +is even, return half of `x`, and if `x` is odd, return +`3x + 1`. + +This should make you familiar with arithmetic and +conditional logic. + + +Exercise 2: Running code ------------------------ Write a function `cond-add-inv` in a file called `a.slip`. @@ -448,7 +460,7 @@ may want to try out the `--babysteps` feature (see `myslip --help`). -Exercise 2: Fibonacci sequence +Exercise 3: Fibonacci sequence ------------------------------ Write a function that calculates the n:th fibonacci number, @@ -468,7 +480,7 @@ n saved ``` -Exercise 3: Generic functions – the identity +Exercise 4: Generic functions – the identity -------------------------------------------- Write the identity function for any type. @@ -477,7 +489,7 @@ This should make you familiar with typing function definitions that contain generics. -Exercise 4: Map left / right (integers) +Exercise 5: Map left / right (integers) --------------------------------------- Write functions `map-left` and `map-right` that take a |