Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EXTERNAL] Fixing a few minor things in subjects from the RUST piscine #2663

Merged
merged 10 commits into from
Nov 20, 2024
5 changes: 4 additions & 1 deletion subjects/borrow_box/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
>
> 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

Expand Down
3 changes: 2 additions & 1 deletion subjects/nextprime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +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.

> 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

Expand Down
3 changes: 3 additions & 0 deletions subjects/previousprime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ 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.

### Expected function

```rust
Expand Down
3 changes: 3 additions & 0 deletions subjects/prime_checker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ 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.

> 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.

### Expected Function and structure
Expand Down
5 changes: 3 additions & 2 deletions subjects/scores/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

### Instructions

Lets play a little.
Let's 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.

Expand All @@ -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
Expand Down
Loading