diff --git a/subjects/blood_types_s/README.md b/subjects/blood_types_s/README.md index e8bcdf2c7..e8a977d90 100644 --- a/subjects/blood_types_s/README.md +++ b/subjects/blood_types_s/README.md @@ -33,12 +33,12 @@ pub enum Antigen { } #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)] -enum RhFactor { +pub enum RhFactor { Positive, Negative, } -#[derive(PartialEq, Eq, PartialOrd, Ord, Clone)] +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)] pub struct BloodType { pub antigen: Antigen, pub rh_factor: RhFactor, @@ -52,6 +52,7 @@ impl BloodType { } pub fn recipients(&self) -> Vec { + } } ``` diff --git a/subjects/brackets_matching/README.md b/subjects/brackets_matching/README.md index 21960986d..d65c44615 100644 --- a/subjects/brackets_matching/README.md +++ b/subjects/brackets_matching/README.md @@ -2,24 +2,35 @@ ### Instructions -Write a program that takes an undefined number of `string` in arguments. For each argument, if the expression is correctly bracketed, the program prints on the standard output `OK` followed by a newline (`'\n'`), otherwise it prints `Error` followed by a newline. +Write a `program` that takes an undefined number of `string` in arguments. For each argument, if the expression is correctly bracketed, the program prints on the standard output `OK` followed by a newline (`'\n'`), otherwise it prints `Error` followed by a newline. Symbols considered as brackets are parentheses `(` and `)`, square brackets `[` and `]` and curly braces `{` and `}`. Every other symbols are simply ignored. -An opening bracket must always be closed by the good closing bracket in the correct order. A `string` which does not contain any bracket is considered as a correctly bracketed `string`. +An opening bracket must always be closed by the good closing bracket in the correct order. A `string` which does not contain any bracket is considered as a correctly bracketed. If there is no argument, the program must print nothing. +For receiving arguments from the command line you should use something like: + +```rust +fn main() { + let args: Vec = std::env::args().collect(); + + //... +} + +``` + ### Usage ```console -$ go run . '(johndoe)' | cat -e -OK$ -$ go run . '([)]' | cat -e -Error$ -$ go run . '' '{[(0 + 0)(1 + 1)](3*(-1)){()}}' | cat -e -OK$ -OK$ -$ go run . -$ +$ cargo run '(johndoe)' | cat -e +OK +$ cargo run '([)]' | cat -e +Error +$ cargo run + +$ cargo run '' '{[(0 + 0)(1 + 1)](3*(-1)){()}}' | cat -e +OK +OK ``` diff --git a/subjects/brain_fuck/README.md b/subjects/brain_fuck/README.md index abcf729d5..874dc6773 100644 --- a/subjects/brain_fuck/README.md +++ b/subjects/brain_fuck/README.md @@ -5,7 +5,7 @@ Write a `Brainfuck` interpreter program. The source code will be given as first parameter. The code will always be valid, with less than 4096 operations. -`Brainfuck` is a minimalist language. It consists of an array of bytes (in this exercice 2048 bytes) all initialized with zero, and with a pointer to its first byte. +`Brainfuck` is a minimalist language. It consists of an array of bytes (in this exercise 2048 bytes) all initialized with zero, and with a pointer to its first byte. Every operator consists of a single character : @@ -22,11 +22,11 @@ Any other character is a comment. For receiving arguments from the command line you should use something like: ```rust - fn main() { - let args: Vec = std::env::args().collect(); +fn main() { + let args: Vec = std::env::args().collect(); - brain_fuck(&args[1]); - } + brain_fuck(&args[1]); +} ``` diff --git a/subjects/display_table/README.md b/subjects/display_table/README.md index 30894bec1..11ee081e7 100644 --- a/subjects/display_table/README.md +++ b/subjects/display_table/README.md @@ -2,9 +2,9 @@ ### Instructions -- Implement the `std::fmt::Display` trait for the structure table so that the table is printed like in the **[Usage](#usage)**. The length of each column must adjust to the longest element of the column and the element must be centered in the "cell" when possible. If the length of the element doees not allow to center exactly, it must descend slightly to the right. +- Implement the `std::fmt::Display` trait for the structure table so that the table is printed like in the **[Usage](#usage)**. The length of each column must adjust to the longest element of the column and the element must be centered in the "cell" when possible. If the length of the element does not allow to center exactly, it must be offset slightly to the left. - - Note: If the table is empty `println!` must not print anything. + - Note: If the table is empty (does not have a header), `println!` must not print anything. - Define the associated function `new` which creates a new empty table. @@ -22,7 +22,7 @@ pub struct Table { impl fmt::Display for Table { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - } + } } impl Table { diff --git a/subjects/filter_table/README.md b/subjects/filter_table/README.md index a1663ec16..5b0128b09 100644 --- a/subjects/filter_table/README.md +++ b/subjects/filter_table/README.md @@ -4,17 +4,13 @@ - Define the **functions**: - - new: which creates a new empty table. + - `new`: which creates a new empty table. - - add_rows: which adds a new row to the table from a slice of strings. + - `add_rows`: which adds a new row to the table from a slice of strings. - - filter_cols: which receives a closure which receives a `&str` and returns a `bool` value: + - `filter_cols`: which receives a closure and returns a table with all the columns that yielded true when applying that closure. The closure will receive a `&str` and return a `bool` value. - - filter_cols returns a table with all the columns that yielded true when applied to the header. - - - filter_rows: which receives a closure that receives a `&str` and returns a `bool` value - - - filter_rows returns a table with all the columns that yielded true when applied to the elements of the selected column. + - `filter_rows`: which receives a closure and returns a table with all the rows that yielded true when applied to the elements of the selected column. The closure will receive a `&str` and return a `bool` value. ### Expected functions and Structures @@ -34,11 +30,11 @@ impl Table { } - pub fn filter_col(&self, filter: ) -> Option { + pub fn filter_col(&self, filter: T) -> Option { } - pub fn filter_row(&self, col_name: &str, filter: ) -> Option { + pub fn filter_row(&self, col_name: &str, filter: T) -> Option { } } diff --git a/subjects/flat_tree/README.md b/subjects/flat_tree/README.md index f7f93c2f3..786456a40 100644 --- a/subjects/flat_tree/README.md +++ b/subjects/flat_tree/README.md @@ -1,4 +1,4 @@ -## flat_rust +## flat_tree ### Instructions diff --git a/subjects/matrix_determinant/determinant-of-a-3x3-matrix-formula-3.png b/subjects/matrix_determinant/determinant-of-a-3x3-matrix-formula-3.png new file mode 100644 index 000000000..a513cdb8a Binary files /dev/null and b/subjects/matrix_determinant/determinant-of-a-3x3-matrix-formula-3.png differ