From 9fff9089fae271a718fcf8af2e68bda34b64234d Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 6 Oct 2023 15:32:02 +0200 Subject: [PATCH] vault backup: 2023-10-06 15:32:02 --- .obsidian/workspace.json | 21 +++++++++++++++---- Algo/Courses/Chapter 6 - Lists (Exercises).md | 11 ++++++++-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 2f0e932..91e6657 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -10,6 +10,18 @@ { "id": "c542bf78ebad15cb", "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "Algo/Courses/Chapter 6 - Lists.md", + "mode": "source", + "source": false + } + } + }, + { + "id": "eaf65669cfff2a2c", + "type": "leaf", "state": { "type": "markdown", "state": { @@ -19,7 +31,8 @@ } } } - ] + ], + "currentTab": 1 } ], "direction": "vertical" @@ -156,19 +169,19 @@ "command-palette:Open command palette": false } }, - "active": "c542bf78ebad15cb", + "active": "eaf65669cfff2a2c", "lastOpenFiles": [ + "Algo/Courses/Chapter 6 - Lists.md", + "Algo/Courses/Chapter 6 - Lists (Exercises).md", "Algo/Séminaire/Exercices seminaire.md", "Prog/Loops.md", "Algo/CM/CM du 04 octobre.md", "Prog", "Algo/CM/CM du 27 septembre.md", "Algo/Séminaire/Remediation.md", - "Algo/Courses/Chapter 6 - Lists.md", "Methodologie/Communication.md", "Methodologie/Le cahier des charges.md", "Methodologie/Gestion.md", - "Algo/Courses/Chapter 6 - Lists (Exercises).md", "Algo/Séminaire/Chapter 3 - Case analysis.md", "Algo/Courses", "Algo/Séminaire/Chapter 5 - Recursivity.md", diff --git a/Algo/Courses/Chapter 6 - Lists (Exercises).md b/Algo/Courses/Chapter 6 - Lists (Exercises).md index 75d7761..3174c80 100644 --- a/Algo/Courses/Chapter 6 - Lists (Exercises).md +++ b/Algo/Courses/Chapter 6 - Lists (Exercises).md @@ -103,6 +103,13 @@ val nth 'a list -> int -> 'a = ## Exercise 2.1 ``` -let rec arith_list n a 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 = + |