docs: implement Miguel's feedback

This commit is contained in:
davhojt 2022-05-24 18:58:08 +03:00 committed by Dav Hojt
parent e0bcdbf5c8
commit f9b7b67a31
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ Represent the cards from a deck:
- Create an `enum` to represent the `Suit`.
- Implement the associated **function** `random`, which returns a random `Suit` (`Heart`, `Diamond`, `Spade` or `Club`).
- Create a `Rank` enum. For ace and face cards, it can be one of `Ace`, `King`, `Queen` or `Jack`. For for the values from 2 to 10, it can have a `Number` value associated to a `u8`.
- Create a `Rank` enum. For ace and face cards, it can be one of `Ace`, `King`, `Queen` or `Jack`. For the values from 2 to 10, it can have a `Number` value associated to a `u8`.
- Create an associated **function** to `Rank` called `Random` that returns a random `Rank`.
- Create a structure name `Card` which has the fields `suit` and `rank`.

View File

@ -4,7 +4,7 @@
Imagine you are working on some software to control smart lights in a house. You have access to an array of all the lights in that house.
Define the associated **function** `new`, and add it to the data structure `Light`. It should create a new light with the alias passed as an argument, with a brightness of .
Define the associated **function** `new`, and add it to the data structure `Light`. It should create a new light with the alias passed as an argument, with a brightness of 0.
Define the **function** `change_brightness`, which receives a `Vec` of lights, an `alias` and a `u8`value. It should find the light in the `Vec` by its alias, and set the value of the brightness.