diff --git a/js/tests/mapper_test.js b/js/tests/mapper_test.js index 591d27da..2392ef5e 100644 --- a/js/tests/mapper_test.js +++ b/js/tests/mapper_test.js @@ -24,18 +24,18 @@ const arrayFormatSentence = (item, index, arr) => { // map t(({ eq, ctx }) => - eq(map(ctx.numbers, add1), [11, -9, 21, -94, 87, 103, 36, 90, 111]), + eq(map(ctx.numbers, add1), [11, -9, 21, -94, 87, 103, 36, 90, 111]) ) t(({ eq, ctx }) => - eq(map(ctx.numbers, mult2), [20, -20, 40, -190, 172, 204, 70, 178, 220]), + eq(map(ctx.numbers, mult2), [20, -20, 40, -190, 172, 204, 70, 178, 220]) ) t(({ eq, ctx }) => - eq(map(ctx.numbers, sub3), [7, -13, 17, -98, 83, 99, 32, 86, 107]), + eq(map(ctx.numbers, sub3), [7, -13, 17, -98, 83, 99, 32, 86, 107]) ) t(({ eq, ctx }) => - eq(map(ctx.numbers, doAll), [19, -21, 39, -191, 171, 203, 69, 177, 219]), + eq(map(ctx.numbers, doAll), [19, -21, 39, -191, 171, 203, 69, 177, 219]) ) t(({ eq, ctx }) => @@ -49,7 +49,7 @@ t(({ eq, ctx }) => '6: 35', '7: 89', '8: 110', - ]), + ]) ) t(({ eq, ctx }) => @@ -63,53 +63,53 @@ t(({ eq, ctx }) => '35 is at index: 6 out of 8', '89 is at index: 7 out of 8', '110 is at index: 8 out of 8', - ]), + ]) ) t(({ eq, ctx }) => eq( map(ctx.sentences[0], arrayFormatSentence).join(''), - 'Colombia, Mexico, and El Salvador are 3 Spanish speaking countries.', - ), + 'Colombia, Mexico, and El Salvador are 3 Spanish speaking countries.' + ) ) t(({ eq, ctx }) => eq( map(ctx.sentences[1], arrayFormatSentence).join(''), - 'Perou, Brazil, Argentina, and Venezuela are 4 countries in South America.', - ), + 'Perou, Brazil, Argentina, and Venezuela are 4 countries in South America.' + ) ) t(({ eq, ctx }) => eq( map(ctx.sentences[2], arrayFormatSentence).join(''), - 'France, Portugal, and Italy are 3 members of the EU.', - ), + 'France, Portugal, and Italy are 3 members of the EU.' + ) ) -t(({ eq, ctx }) => +t(({ eq }) => // map should not flat eq( - map([1, 2, 3], n => [n, n]), + map([1, 2, 3], (n) => [n, n]), [ [1, 1], [2, 2], [3, 3], - ], - ), + ] + ) ) // flatMap -t(({ eq, ctx }) => +t(({ eq }) => // flatMap should flatten the result of map eq( - flatMap([1, 2, 3], n => [n, n]), - [1, 1, 2, 2, 3, 3], - ), + flatMap([1, 2, 3], (n) => [n, n]), + [1, 1, 2, 2, 3, 3] + ) ) t(({ eq, ctx }) => - eq(flatMap(ctx.mixed, add1), ['101', -9, 21, -94, 87, '1021', '35,891', 111]), + eq(flatMap(ctx.mixed, add1), ['101', -9, 21, -94, 87, '1021', '35,891', 111]) ) t(({ eq, ctx }) => @@ -122,7 +122,7 @@ t(({ eq, ctx }) => '5: 102', undefined, '7: 110', - ]), + ]) ) t(({ eq, ctx }) => @@ -135,7 +135,7 @@ t(({ eq, ctx }) => '-33 is at index: 5 out of 7', '-4 is at index: 6 out of 7', '18 is at index: 7 out of 7', - ]), + ]) ) Object.freeze(tests) diff --git a/subjects/currify/README.md b/subjects/currify/README.md index 23a9f27c..505d66e0 100644 --- a/subjects/currify/README.md +++ b/subjects/currify/README.md @@ -5,9 +5,10 @@ Create the function `currify` that will curry any functions put as argument. example: + ```js const mult2 = (el1,el2) => el1 * el2 -console.log(mult2(2,2)) // result epected 4 +console.log(mult2(2,2)) // result expected 4 const mult2Curried = currify(mult2) diff --git a/subjects/go-reloaded/README.md b/subjects/go-reloaded/README.md index dce835cc..0a6c49b6 100644 --- a/subjects/go-reloaded/README.md +++ b/subjects/go-reloaded/README.md @@ -643,19 +643,19 @@ student@ubuntu:~/[[ROOT]]/test$ ### Instructions -Write a program that has the same behaviour as the system's `cat` command-line. +Write a program that behaves like a simplified `cat` command. - The `options` do not have to be handled. -- If the program is called without arguments it should take the `input` and print it back (as shown with the "Hello" example below). +- If the program is called without arguments it should take the standard input (stdin) and print it back on the standard output (stdout). - In the program folder create two files named `quest8.txt` and `quest8T.txt`. -- Copy to the `quest8.txt` file the following sentence : +- Copy to the `quest8.txt` file the following sentence, with a new line ate the end of the file : `"Programming is a skill best acquired by practice and example rather than from books" by Alan Turing` -- Copy to the `quest8T.txt` file the following sentence : +- Copy to the `quest8T.txt` file the following sentence, with a new line ate the end of the file : `"Alan Mathison Turing was an English mathematician, computer scientist, logician, cryptanalyst. Turing was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general-purpose computer. Turing is widely considered to be the father of theoretical computer science and artificial intelligence."` @@ -666,7 +666,7 @@ Write a program that has the same behaviour as the system's `cat` command-line. ```console student@ubuntu:~/[[ROOT]]/cat$ go build student@ubuntu:~/[[ROOT]]/cat$ ./cat abc -open abc: no such file or directory +ERROR: abc: No such file or directory student@ubuntu:~/[[ROOT]]/cat$ ./cat quest8.txt "Programming is a skill best acquired by pratice and example rather than from books" by Alan Turing student@ubuntu:~/[[ROOT]]/cat$ ./cat @@ -853,8 +853,6 @@ student@ubuntu:~/[[ROOT]]/test$ Write a function `SortedListMerge` that merges two lists `n1` and `n2` in ascending order. -- During the tests `n1` and `n2` will already be initially sorted. - ### Expected function and structure ```go diff --git a/subjects/go-reloaded/audit/README.md b/subjects/go-reloaded/audit/README.md index f10a5e1d..eb82ea09 100644 --- a/subjects/go-reloaded/audit/README.md +++ b/subjects/go-reloaded/audit/README.md @@ -576,7 +576,7 @@ slice = [1 2 3 A B C a b c] and f = func(a, b string) int { ###### Does the program displays the content of the file in order? -##### Run the program with a diferent file and then run the system program `cat` with the same file. +##### Run the program with a different file and then run the system program `cat` with the same file. ###### Are the outputs identical? diff --git a/subjects/mapper/README.md b/subjects/mapper/README.md index 7e763fee..261e8425 100644 --- a/subjects/mapper/README.md +++ b/subjects/mapper/README.md @@ -8,13 +8,11 @@ and that works like the method .map - Create a `flatMap` function that takes an array as first argument, a function as second, and that works like the method .flatMap - ### Notions - [devdocs.io/javascript/global_objects/array/map](https://devdocs.io/javascript/global_objects/array/map) - [devdocs.io/javascript/global_objects/array/flatmap](https://devdocs.io/javascript/global_objects/array/flatmap) - ### Code provided > all code provided will be added to your solution and doesn't need to be submited. diff --git a/subjects/tetris-optimizer/README.md b/subjects/tetris-optimizer/README.md index 30f1709b..2d0ffe56 100644 --- a/subjects/tetris-optimizer/README.md +++ b/subjects/tetris-optimizer/README.md @@ -21,6 +21,11 @@ The program must : - The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). - It is recommended that the code should present a **test file**. +This project will help you learn about: + +- The use of algorithms +- Reading from files + #### Example of a text File ```console