vault backup: 2023-09-12 16:20:45

This commit is contained in:
Louis Gallet 2023-09-12 16:20:45 +02:00
parent 42e289c63f
commit e500ac3dac
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY

View File

@ -39,7 +39,18 @@ To write a recurvise function we need two things
### 5.2. Down
```Ocaml
# let rec countdown n =
if n = 0 then
print_int(0)
if n < 0 then
()
else
print_int(countdown (n-1));;
begin
print_int n ;
print_newline();
countdown(n-1);
end;;
val countdown = int -> unit = ()
# countdown 3;;
3
2
1
- : unit = ()