mirror of https://github.com/01-edu/public.git
docs: implement Miguel's feedback
This commit is contained in:
parent
fee990d50a
commit
5f935e29a8
|
@ -4,6 +4,7 @@
|
|||
|
||||
Create a **function** named `arrange_phrase`, that takes a string literal, _sorts_ the words and returns it. Each word will contain a number that indicates the position of that word.
|
||||
|
||||
### Expected Functions
|
||||
```rust
|
||||
pub fn arrange_phrase(phrase: &str) -> String {
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
Create a **function** named `str_len`, you'll need to complete the function signature. Your function should accept a string or a string literal, and return its length without taking ownership of the value (i.e, borrowing the value).
|
||||
|
||||
### Expected functions
|
||||
```rust
|
||||
pub fn str_len(s: ) -> usize {
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ Create the following functions:
|
|||
- `is_correct`: which borrows a Vector of string literals representing simple addition and subtraction equations. The function should replace the correct equations with `✔`, and the wrong ones with `✘`. It should return a `usize` with the percentage of correct equations.
|
||||
|
||||
### Expected Functions
|
||||
|
||||
```rust
|
||||
pub fn delete_and_backspace(s: &mut String) {
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ Create the following **functions**. The objective is to know how ownership works
|
|||
- with the `original` value.
|
||||
- and the `natural logarithm` of each `absolute` value.
|
||||
|
||||
### Expected functions
|
||||
```rust
|
||||
pub fn nbr_function(c: i32) -> (i32, f64, f64) {
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
Create a function named `doubtful` which appends a question mark to every string passed to it. It must not return a value.
|
||||
|
||||
### Expected functions
|
||||
```rust
|
||||
pub fn doubtful(s: /*give the correct type*/ ) {
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
Create a **function** named `initials`. This function will receive a vector of string literals with names, and return a vector of Strings with the initials of each name.
|
||||
|
||||
### Expected Functions
|
||||
```rust
|
||||
pub fn initials(names: Vec<&str>) -> Vec<String> {
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
Create a **function** named `first_subword`, that takes ownership of a string and returns the first sub-word in it. It should work for `camelCase`, `PascalCase`, and `snake_case`.
|
||||
|
||||
### Expected functions
|
||||
```rust
|
||||
pub fn first_subword(mut s: String) -> String {
|
||||
}
|
||||
|
|
|
@ -8,8 +8,9 @@ Create the following functions:
|
|||
- `is_ascii`: that returns `true` if all characters are within the ASCII range.
|
||||
- `contains`: that returns `true` if the string contains the given pattern.
|
||||
- `split_at`: that divides a string in two returning a tuple.
|
||||
- `find`: that returns the index if the first character of a given string that matches the pattern.
|
||||
- `find`: that returns the index of the first character of a given string that matches the pattern.
|
||||
|
||||
### Expected functions
|
||||
```rust
|
||||
pub fn is_empty(v: &str) -> bool {
|
||||
}
|
||||
|
|
|
@ -6,14 +6,14 @@ You must create some functions for a tic-tac-toe checker.
|
|||
|
||||
Create a function named `tic_tac_toe`, which receives a tic-tac-toe table. It should return the appropriate string: `"player O won"`, `"player X won"` or `"Tie"`.
|
||||
|
||||
```rust
|
||||
pub fn tic_tac_toe(table: Vec<Vec<&str>>) -> String {
|
||||
}
|
||||
```
|
||||
|
||||
Also create the following functions, which each accept a player and a table. These functions should return `true` if the player has completed one of the diagonals, rows or columns:
|
||||
|
||||
### Expected functions
|
||||
```rust
|
||||
pub fn tic_tac_toe(table: Vec<Vec<&str>>) -> String {
|
||||
}
|
||||
|
||||
pub fn diagonals(player: &str, table: &Vec<Vec<&str>>) -> bool {
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
Create a **function** named `to_url` which takes a string and substitutes every white-space with `"%20"`.
|
||||
|
||||
### Expected functions
|
||||
```rust
|
||||
pub fn to_url(s: &str) -> String {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue