Browse Source

Add extra instructions

content-update
Augusto 3 years ago
parent
commit
65a84af2fb
  1. 9
      subjects/highest/README.md
  2. 5
      subjects/iterators/README.md

9
subjects/highest/README.md

@ -6,9 +6,10 @@ In this exercise a `Numbers` struct will be given.
These methods have to be written:
- `List` that returns an `array` with every number in the struct
- `Latest` that returns an `Option<u32>` with the last added number
- `Highest` that return an `Option<u32>` with the highest number from the list,
- `new` create a new instance of Number.
- `List` that returns an `array` with every number in the struct.
- `Latest` that returns an `Option<u32>` with the last added number.
- `Highest` that return an `Option<u32>` with the highest number from the list.
- `Highest_Three` that returns a `Vec<u32>` with the three highest numbers.
### Notions
@ -18,6 +19,8 @@ These methods have to be written:
### Expected functions
```rust
pub fn new(&[u32]) -> Self {}
pub fn List(&self) -> &[u32] {}
pub fn Latest(&self) -> Option<u32> {}

5
subjects/iterators/README.md

@ -2,10 +2,9 @@
### Instructions
Create a method `new` that takes one number `usize` and initializes the `Number` struct.
Create a method `new` that takes one number `usize` and initializes the struct `Number`.
This method will have to determinate if the given number is even or odd. If it is even you will have to increment it by one to the next odd number and
if it is odd you have to increment by one to the next even number.
This method will have to determinate if the given number is even or odd. If it is even you will have to increment it by one to the next odd number and if it is odd you have to increment by one to the next even number.
After that you will implement an iterator for the struct `Number` that returns a tuple (usize,usize,usize) containing each field of the struct Number.

Loading…
Cancel
Save