From 4e29a4e19846c82361638e695c7221092580b99a Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 3 Feb 2021 19:53:35 +0000 Subject: [PATCH] additional informations --- subjects/division_and_remainder/README.md | 14 +++++++++++--- subjects/matrix_transposition/README.md | 2 ++ subjects/tuples/README.md | 18 ++++++++++++++++-- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/subjects/division_and_remainder/README.md b/subjects/division_and_remainder/README.md index 71f58c97..525e4171 100644 --- a/subjects/division_and_remainder/README.md +++ b/subjects/division_and_remainder/README.md @@ -2,7 +2,15 @@ ### Instructions -Create a function divide that receives two i32 and returns a tuple in which the first element is the result of the integer division between the two numbers and the second is the remainder of the division. +Create a **function** `divide` that receives two i32 and returns a tuple in which the first element is the result of the integer division between the two numbers and the second is the remainder of the division. + +### Notions + +- [The Tuple Type](https://doc.rust-lang.org/stable/book/ch03-02-data-types.html?highlight=accessing%20a%20tuple#compound-types) + +- [Tuples](https://doc.rust-lang.org/rust-by-example/primitives/tuples.html) + +- [Tuple Structs without Named Fields](https://doc.rust-lang.org/stable/book/ch05-01-defining-structs.html?highlight=tuple#using-tuple-structs-without-named-fields-to-create-different-types) ### Expected Function @@ -14,10 +22,10 @@ pub fn divide(x: i32, y: i32) -> (i32, i32) { ### Usage -Here is a program to test you're function +Here is a program to test your function ```rust -use division_and_remainder::division_and_remainder; +use division_and_remainder::divide; fn main() { let x = 9; diff --git a/subjects/matrix_transposition/README.md b/subjects/matrix_transposition/README.md index b538a7d1..64863790 100644 --- a/subjects/matrix_transposition/README.md +++ b/subjects/matrix_transposition/README.md @@ -27,6 +27,8 @@ Example: - [The Tuple Type](https://doc.rust-lang.org/stable/book/ch03-02-data-types.html?highlight=accessing%20a%20tuple#compound-types) +- [Tuples](https://doc.rust-lang.org/rust-by-example/primitives/tuples.html) + - [Tuple Structs without Named Fields](https://doc.rust-lang.org/stable/book/ch05-01-defining-structs.html?highlight=tuple#using-tuple-structs-without-named-fields-to-create-different-types) - [Adding Useful Functionality with Derived Traits](https://doc.rust-lang.org/stable/book/ch05-02-example-structs.html?highlight=debug%20deriv#adding-useful-functionality-with-derived-traits) diff --git a/subjects/tuples/README.md b/subjects/tuples/README.md index be01cc7f..2209f676 100644 --- a/subjects/tuples/README.md +++ b/subjects/tuples/README.md @@ -2,12 +2,26 @@ ### Instructions -- Define a tuple structure to represent a student. +- Define a tuple structure to represent a `Student`. - Each student is identified by an id number of type i32, his/her name and his/her last name as a string Print the content of the tuple to stdout - Then define three functions to return the id, first name and last name. +### Notions + +- [Defining a struct](https://doc.rust-lang.org/stable/book/ch05-01-defining-structs.html) + +- [The Tuple Type](https://doc.rust-lang.org/stable/book/ch03-02-data-types.html?highlight=accessing%20a%20tuple#compound-types) + +- [Tuples](https://doc.rust-lang.org/rust-by-example/primitives/tuples.html) + +- [Tuple Structs without Named Fields](https://doc.rust-lang.org/stable/book/ch05-01-defining-structs.html?highlight=tuple#using-tuple-structs-without-named-fields-to-create-different-types) + +- [Adding Useful Functionality with Derived Traits](https://doc.rust-lang.org/stable/book/ch05-02-example-structs.html?highlight=debug%20deriv#adding-useful-functionality-with-derived-traits) + +- [Chapter 7](https://doc.rust-lang.org/stable/book/ch07-03-paths-for-referring-to-an-item-in-the-module-tree.html) + ### Expected Functions ```rust @@ -23,7 +37,7 @@ pub fn last_name(student: &Student) -> String { ### Usage -Here is a program to test you're functions +Here is a program to test your functions ```rust use tuples::*;