From 92456ced1971b0fc89f23354556491607a883bc7 Mon Sep 17 00:00:00 2001 From: theoldestbrother Date: Thu, 25 Jul 2024 12:51:56 +0200 Subject: [PATCH 1/7] Adding a reminder of what a prime is --- subjects/nextprime/README.md | 3 +++ subjects/previousprime/README.md | 5 +++++ subjects/prime_checker/README.md | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/subjects/nextprime/README.md b/subjects/nextprime/README.md index 2eb7e7efaf..37efe26009 100644 --- a/subjects/nextprime/README.md +++ b/subjects/nextprime/README.md @@ -6,6 +6,9 @@ Create a **function** which returns the first prime number which is greater than The function must be optimized, so as to avoid time-outs. +> [!TIP] +> As a reminder, a `prime number` is a whole number greater than 1 that cannot be exactly divided by any whole number other than itself and 1. + > We consider that only positive numbers can be prime numbers. ### Expected function diff --git a/subjects/previousprime/README.md b/subjects/previousprime/README.md index 8cd5c12948..2498668279 100644 --- a/subjects/previousprime/README.md +++ b/subjects/previousprime/README.md @@ -6,6 +6,11 @@ Create a **function** which returns the first prime number which is less than or If there are no smaller primes, the function should return `0`. +> [!TIP] +> As a reminder, a `prime number` is a whole number greater than 1 that cannot be exactly divided by any whole number other than itself and 1. + +> We consider that only positive numbers can be prime numbers. + ### Expected function ```rust diff --git a/subjects/prime_checker/README.md b/subjects/prime_checker/README.md index 2389bb3c3c..8a8b307328 100644 --- a/subjects/prime_checker/README.md +++ b/subjects/prime_checker/README.md @@ -8,6 +8,11 @@ The result will be `None` if the argument is less or equal one, otherwise it wil If the `u32` is prime, the function will return an`Ok(u32)`. For any other case it will return an `enum` `PrimeErr`. The `enum` `PrimeErr` will be `Even` if the number is a multiple of two or `Divider(u32)` where the `u32` is the smallest divider of the number. +> [!TIP] +> As a reminder, a `prime number` is a whole number greater than 1 that cannot be exactly divided by any whole number other than itself and 1. + +> We consider that only positive numbers can be prime numbers. + > Your solution should be optimized to a certain degree. ### Expected Function and structure From 2e0b2d0a2979869825372b0b22044c02c9c9fe24 Mon Sep 17 00:00:00 2001 From: theoldestbrother Date: Thu, 25 Jul 2024 15:48:46 +0200 Subject: [PATCH 2/7] Specifying the function input type to avoid a simple mistake --- subjects/scores/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/scores/README.md b/subjects/scores/README.md index ff8df267c1..fed6ac3f27 100644 --- a/subjects/scores/README.md +++ b/subjects/scores/README.md @@ -4,7 +4,7 @@ Lets play a little. -Create a function named `score` that given a string, computes the score for that given string as a `u64`. +Create a function named `score` that given a `&str`, computes the score for that given string as a `u64`. Each letter has a value, you just have to sum the values of the letters in the given string. From be2160ac3b6e7b3f8e340bc2a4a20774774e58f8 Mon Sep 17 00:00:00 2001 From: theoldestbrother Date: Thu, 25 Jul 2024 16:20:29 +0200 Subject: [PATCH 3/7] Changing the explanation of the nb_games variable so it is more understandable as a few student struggle to understand what the intended use was for it --- subjects/borrow_box/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subjects/borrow_box/README.md b/subjects/borrow_box/README.md index de0f33cba4..054251b2ec 100644 --- a/subjects/borrow_box/README.md +++ b/subjects/borrow_box/README.md @@ -14,7 +14,10 @@ You will implement some **CRUD** functionality for a game session. You will need - `delete`: which takes ownership of the boxed game session and returns a string: `"game deleted: id -> 0"`, where `0` is the id of the `GameSession`. -> If `nb_games` is 5, then it is "best out of 5", and no more than 5 games can be played. If some player has a score of 3, then the game session is also finished. This is because there is an insufficient number of remaining games for the trailing player to catch up. +> Examples for `nb_games`: +> +> `nb_games` = **5** --> the maximum of games will be **5** and if some player has a score of 3, the game is finished (not enough games for the other player to win).\ +> `nb_games` = **11** --> the maximum of games will be **11** and if some player has a score of 6, the game is finished (not enough games for the other player to win). ### Expected Functions From 7c0a72d710ad95a32e3519566cdf5b4e494099df Mon Sep 17 00:00:00 2001 From: theoldestbrother Date: Fri, 2 Aug 2024 16:47:29 +0200 Subject: [PATCH 4/7] fixing a formating issue --- subjects/scores/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/subjects/scores/README.md b/subjects/scores/README.md index fed6ac3f27..c767e2eda7 100644 --- a/subjects/scores/README.md +++ b/subjects/scores/README.md @@ -21,6 +21,7 @@ You will need these: | Q, Z | 10 | ### Expected functions + > You'll need to work out the function signature for yourself. ### Usage From 8c2cde578d19d5498db80850ca4eac9f9bccd81c Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Wed, 20 Nov 2024 11:18:17 +0000 Subject: [PATCH 5/7] made some minor changes to the READMEs --- subjects/borrow_box/README.md | 4 ++-- subjects/nextprime/README.md | 6 ++---- subjects/previousprime/README.md | 6 ++---- subjects/prime_checker/README.md | 6 ++---- subjects/scores/README.md | 2 +- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/subjects/borrow_box/README.md b/subjects/borrow_box/README.md index 054251b2ec..c452202a0b 100644 --- a/subjects/borrow_box/README.md +++ b/subjects/borrow_box/README.md @@ -16,8 +16,8 @@ You will implement some **CRUD** functionality for a game session. You will need > Examples for `nb_games`: > -> `nb_games` = **5** --> the maximum of games will be **5** and if some player has a score of 3, the game is finished (not enough games for the other player to win).\ -> `nb_games` = **11** --> the maximum of games will be **11** and if some player has a score of 6, the game is finished (not enough games for the other player to win). +> When `nb_games` is 5, the game is best out of 5, and if some player has a score of 3, the game is finished (there aren't enough games for the other player to draw). +> When `nb_games` is 11, the game is best out of 11, and if some player has a score of 6, the game is finished (there aren't enough games for the other player to draw). ### Expected Functions diff --git a/subjects/nextprime/README.md b/subjects/nextprime/README.md index 37efe26009..f22db85c24 100644 --- a/subjects/nextprime/README.md +++ b/subjects/nextprime/README.md @@ -6,10 +6,8 @@ Create a **function** which returns the first prime number which is greater than The function must be optimized, so as to avoid time-outs. -> [!TIP] -> As a reminder, a `prime number` is a whole number greater than 1 that cannot be exactly divided by any whole number other than itself and 1. - -> We consider that only positive numbers can be prime numbers. +> A prime number is a natural number greater than 1 that is a not a product of two smaller natural numbers. +> 4 is not a prime number (so it's called a composite number) because it can be represented as 2 * 2. 5 is a prime number as it can only be represented by 5 * 1 or 1 * 5. ### Expected function diff --git a/subjects/previousprime/README.md b/subjects/previousprime/README.md index 2498668279..7cd792a309 100644 --- a/subjects/previousprime/README.md +++ b/subjects/previousprime/README.md @@ -6,10 +6,8 @@ Create a **function** which returns the first prime number which is less than or If there are no smaller primes, the function should return `0`. -> [!TIP] -> As a reminder, a `prime number` is a whole number greater than 1 that cannot be exactly divided by any whole number other than itself and 1. - -> We consider that only positive numbers can be prime numbers. +> A prime number is a natural number greater than 1 that is a not a product of two smaller natural numbers. +> 4 is not a prime number (so it's called a composite number) because it can be represented as 2 * 2. 5 is a prime number as it can only be represented by 5 * 1 or 1 * 5. ### Expected function diff --git a/subjects/prime_checker/README.md b/subjects/prime_checker/README.md index 8a8b307328..e2df0b25e0 100644 --- a/subjects/prime_checker/README.md +++ b/subjects/prime_checker/README.md @@ -8,10 +8,8 @@ The result will be `None` if the argument is less or equal one, otherwise it wil If the `u32` is prime, the function will return an`Ok(u32)`. For any other case it will return an `enum` `PrimeErr`. The `enum` `PrimeErr` will be `Even` if the number is a multiple of two or `Divider(u32)` where the `u32` is the smallest divider of the number. -> [!TIP] -> As a reminder, a `prime number` is a whole number greater than 1 that cannot be exactly divided by any whole number other than itself and 1. - -> We consider that only positive numbers can be prime numbers. +> A prime number is a natural number greater than 1 that is a not a product of two smaller natural numbers. +> 4 is not a prime number (so it's called a composite number) because it can be represented as 2 * 2. 5 is a prime number as it can only be represented by 5 * 1 or 1 * 5. > Your solution should be optimized to a certain degree. diff --git a/subjects/scores/README.md b/subjects/scores/README.md index c767e2eda7..e7d7d5a083 100644 --- a/subjects/scores/README.md +++ b/subjects/scores/README.md @@ -2,7 +2,7 @@ ### Instructions -Lets play a little. +Let's play a little. Create a function named `score` that given a `&str`, computes the score for that given string as a `u64`. From 481c2d552a3bb17541bd5bf4d05c44b6a5dc8e1a Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Wed, 20 Nov 2024 11:35:14 +0000 Subject: [PATCH 6/7] added compliance with prettier to changed markdown files --- subjects/nextprime/README.md | 2 +- subjects/previousprime/README.md | 2 +- subjects/prime_checker/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/subjects/nextprime/README.md b/subjects/nextprime/README.md index f22db85c24..ec60de8de7 100644 --- a/subjects/nextprime/README.md +++ b/subjects/nextprime/README.md @@ -7,7 +7,7 @@ Create a **function** which returns the first prime number which is greater than The function must be optimized, so as to avoid time-outs. > A prime number is a natural number greater than 1 that is a not a product of two smaller natural numbers. -> 4 is not a prime number (so it's called a composite number) because it can be represented as 2 * 2. 5 is a prime number as it can only be represented by 5 * 1 or 1 * 5. +> 4 is not a prime number (so it's called a composite number) because it can be represented as 2 _ 2. 5 is a prime number as it can only be represented by 5 _ 1 or 1 \* 5. ### Expected function diff --git a/subjects/previousprime/README.md b/subjects/previousprime/README.md index 7cd792a309..5d714c57c2 100644 --- a/subjects/previousprime/README.md +++ b/subjects/previousprime/README.md @@ -7,7 +7,7 @@ Create a **function** which returns the first prime number which is less than or If there are no smaller primes, the function should return `0`. > A prime number is a natural number greater than 1 that is a not a product of two smaller natural numbers. -> 4 is not a prime number (so it's called a composite number) because it can be represented as 2 * 2. 5 is a prime number as it can only be represented by 5 * 1 or 1 * 5. +> 4 is not a prime number (so it's called a composite number) because it can be represented as 2 _ 2. 5 is a prime number as it can only be represented by 5 _ 1 or 1 \* 5. ### Expected function diff --git a/subjects/prime_checker/README.md b/subjects/prime_checker/README.md index e2df0b25e0..9640627bcc 100644 --- a/subjects/prime_checker/README.md +++ b/subjects/prime_checker/README.md @@ -9,7 +9,7 @@ If the `u32` is prime, the function will return an`Ok(u32)`. For any other case The `enum` `PrimeErr` will be `Even` if the number is a multiple of two or `Divider(u32)` where the `u32` is the smallest divider of the number. > A prime number is a natural number greater than 1 that is a not a product of two smaller natural numbers. -> 4 is not a prime number (so it's called a composite number) because it can be represented as 2 * 2. 5 is a prime number as it can only be represented by 5 * 1 or 1 * 5. +> 4 is not a prime number (so it's called a composite number) because it can be represented as 2 _ 2. 5 is a prime number as it can only be represented by 5 _ 1 or 1 \* 5. > Your solution should be optimized to a certain degree. From e4680739b7c8b839c9f35c96259391170f3a9b90 Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Wed, 20 Nov 2024 11:53:38 +0000 Subject: [PATCH 7/7] prettier inferred incorrectly in some formatting, fixing it --- subjects/nextprime/README.md | 2 +- subjects/previousprime/README.md | 2 +- subjects/prime_checker/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/subjects/nextprime/README.md b/subjects/nextprime/README.md index ec60de8de7..d80c8bba1a 100644 --- a/subjects/nextprime/README.md +++ b/subjects/nextprime/README.md @@ -7,7 +7,7 @@ Create a **function** which returns the first prime number which is greater than The function must be optimized, so as to avoid time-outs. > A prime number is a natural number greater than 1 that is a not a product of two smaller natural numbers. -> 4 is not a prime number (so it's called a composite number) because it can be represented as 2 _ 2. 5 is a prime number as it can only be represented by 5 _ 1 or 1 \* 5. +> 4 is not a prime number (so it's called a composite number) because it can be represented as 2 \* 2. 5 is a prime number as it can only be represented by 5 \* 1 or 1 \* 5. ### Expected function diff --git a/subjects/previousprime/README.md b/subjects/previousprime/README.md index 5d714c57c2..a3a87ba9ea 100644 --- a/subjects/previousprime/README.md +++ b/subjects/previousprime/README.md @@ -7,7 +7,7 @@ Create a **function** which returns the first prime number which is less than or If there are no smaller primes, the function should return `0`. > A prime number is a natural number greater than 1 that is a not a product of two smaller natural numbers. -> 4 is not a prime number (so it's called a composite number) because it can be represented as 2 _ 2. 5 is a prime number as it can only be represented by 5 _ 1 or 1 \* 5. +> 4 is not a prime number (so it's called a composite number) because it can be represented as 2 \* 2. 5 is a prime number as it can only be represented by 5 \* 1 or 1 \* 5. ### Expected function diff --git a/subjects/prime_checker/README.md b/subjects/prime_checker/README.md index 9640627bcc..8a71fe9e40 100644 --- a/subjects/prime_checker/README.md +++ b/subjects/prime_checker/README.md @@ -9,7 +9,7 @@ If the `u32` is prime, the function will return an`Ok(u32)`. For any other case The `enum` `PrimeErr` will be `Even` if the number is a multiple of two or `Divider(u32)` where the `u32` is the smallest divider of the number. > A prime number is a natural number greater than 1 that is a not a product of two smaller natural numbers. -> 4 is not a prime number (so it's called a composite number) because it can be represented as 2 _ 2. 5 is a prime number as it can only be represented by 5 _ 1 or 1 \* 5. +> 4 is not a prime number (so it's called a composite number) because it can be represented as 2 \* 2. 5 is a prime number as it can only be represented by 5 \* 1 or 1 \* 5. > Your solution should be optimized to a certain degree.