vault backup: 2023-10-09 13:15:29

This commit is contained in:
Louis Gallet 2023-10-09 13:15:29 +02:00
parent 2749a5ed0e
commit 9e34a76dae
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY

View File

@ -110,14 +110,14 @@ let maximum = function
``` ```
## Exercise 2.1 ## Exercise 2.1
```Ocaml
let rec arithmetic_list n a1 r =
if n <= 0 then []
else a1 :: arithmetic_list (n - 1) (a1 + r) r;;
``` ```
let arith_list n a r =
if n < 0 then
invalid_arg "n must be superior to 0"
else if n = 0 then
[]
if n = 1 then
a::[]
else let rec arl =
|
## Exercise 2.2
```Ocaml
let concatenate_lists lst1 lst2 =
lst1 @ lst2;;
```