aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--rush00/README.md5
-rw-r--r--rush00/ex00/main.rs17
-rw-r--r--rush00/ex00/rush00.rs20
-rw-r--r--rush00/ex01/main.rs17
-rw-r--r--rush00/ex01/rush01.rs52
-rw-r--r--rush00/ex02/main.rs17
-rw-r--r--rush00/ex02/rush02.rs52
-rw-r--r--rush00/ex03/main.rs17
-rw-r--r--rush00/ex03/rush03.rs52
-rw-r--r--rush00/ex04/main.rs17
-rw-r--r--rush00/ex04/rush04.rs52
-rw-r--r--subjects/rush00.pdfbin0 -> 1395412 bytes
13 files changed, 321 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 6710ed3..767a3c8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,6 @@ a.out
*.o
*.a
testfiles
+
+rush00/ex*/*
+!rush00/ex*/*.rs
diff --git a/rush00/README.md b/rush00/README.md
new file mode 100644
index 0000000..8f9bd07
--- /dev/null
+++ b/rush00/README.md
@@ -0,0 +1,5 @@
+# rush00
+
+before doing the rush: I needed an simple exercice to learn Rust.
+
+after the rush: Well I just copy pasted stuff, that was a lot of fun
diff --git a/rush00/ex00/main.rs b/rush00/ex00/main.rs
new file mode 100644
index 0000000..f76b7a6
--- /dev/null
+++ b/rush00/ex00/main.rs
@@ -0,0 +1,17 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* main.rs :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/21 12:35:44 by charles #+# #+# */
+/* Updated: 2020/05/21 12:40:37 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+mod rush00;
+
+fn main() {
+ rush00::rush(5, 5);
+}
diff --git a/rush00/ex00/rush00.rs b/rush00/ex00/rush00.rs
new file mode 100644
index 0000000..0b52481
--- /dev/null
+++ b/rush00/ex00/rush00.rs
@@ -0,0 +1,20 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* rush00.rs :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/21 13:38:42 by charles #+# #+# */
+/* Updated: 2020/05/21 13:38:43 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+pub fn rush(x: i32, y: i32) {
+ for _ in 0..y {
+ for _ in 0..x {
+ print!("x");
+ }
+ print!("\n");
+ }
+}
diff --git a/rush00/ex01/main.rs b/rush00/ex01/main.rs
new file mode 100644
index 0000000..ced1d94
--- /dev/null
+++ b/rush00/ex01/main.rs
@@ -0,0 +1,17 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* main.rs :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/21 12:35:44 by charles #+# #+# */
+/* Updated: 2020/05/21 13:35:46 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+mod rush01;
+
+fn main() {
+ rush01::rush(5, 5);
+}
diff --git a/rush00/ex01/rush01.rs b/rush00/ex01/rush01.rs
new file mode 100644
index 0000000..70e1534
--- /dev/null
+++ b/rush00/ex01/rush01.rs
@@ -0,0 +1,52 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* rush01.rs :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/21 13:38:25 by charles #+# #+# */
+/* Updated: 2020/05/21 13:38:25 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+pub fn rush(x: i32, y: i32) {
+ if x == 0 || y == 0 {
+ return ;
+ }
+
+ if x >= 1 {
+ print!("/");
+ }
+ for _ in 1..x - 1 {
+ print!("*");
+ }
+ if x >= 2 {
+ print!("\\");
+ }
+ print!("\n");
+
+ for _ in 1..y - 1 {
+ print!("*");
+ for _ in 1..x - 1 {
+ print!(" ");
+ }
+ if x >= 2 {
+ print!("*");
+ }
+ print!("\n");
+ }
+
+ if y > 1 {
+ if x >= 1 {
+ print!("\\");
+ }
+ for _ in 1..x - 1 {
+ print!("*");
+ }
+ if x >= 2 {
+ print!("/");
+ }
+ print!("\n");
+ }
+}
diff --git a/rush00/ex02/main.rs b/rush00/ex02/main.rs
new file mode 100644
index 0000000..3a14d63
--- /dev/null
+++ b/rush00/ex02/main.rs
@@ -0,0 +1,17 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* main.rs :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/21 12:35:44 by charles #+# #+# */
+/* Updated: 2020/05/21 13:38:07 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+mod rush02;
+
+fn main() {
+ rush02::rush(5, 5);
+}
diff --git a/rush00/ex02/rush02.rs b/rush00/ex02/rush02.rs
new file mode 100644
index 0000000..1f8e519
--- /dev/null
+++ b/rush00/ex02/rush02.rs
@@ -0,0 +1,52 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* rush02.rs :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/21 13:38:19 by charles #+# #+# */
+/* Updated: 2020/05/21 13:40:00 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+pub fn rush(x: i32, y: i32) {
+ if x == 0 || y == 0 {
+ return ;
+ }
+
+ if x >= 1 {
+ print!("A");
+ }
+ for _ in 1..x - 1 {
+ print!("B");
+ }
+ if x >= 2 {
+ print!("A");
+ }
+ print!("\n");
+
+ for _ in 1..y - 1 {
+ print!("B");
+ for _ in 1..x - 1 {
+ print!(" ");
+ }
+ if x >= 2 {
+ print!("B");
+ }
+ print!("\n");
+ }
+
+ if y > 1 {
+ if x >= 1 {
+ print!("C");
+ }
+ for _ in 1..x - 1 {
+ print!("B");
+ }
+ if x >= 2 {
+ print!("C");
+ }
+ print!("\n");
+ }
+}
diff --git a/rush00/ex03/main.rs b/rush00/ex03/main.rs
new file mode 100644
index 0000000..72f41e4
--- /dev/null
+++ b/rush00/ex03/main.rs
@@ -0,0 +1,17 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* main.rs :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/21 12:35:44 by charles #+# #+# */
+/* Updated: 2020/05/21 13:40:34 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+mod rush03;
+
+fn main() {
+ rush03::rush(4, 4);
+}
diff --git a/rush00/ex03/rush03.rs b/rush00/ex03/rush03.rs
new file mode 100644
index 0000000..7113561
--- /dev/null
+++ b/rush00/ex03/rush03.rs
@@ -0,0 +1,52 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* rush03.rs :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/21 13:39:12 by charles #+# #+# */
+/* Updated: 2020/05/21 13:39:57 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+pub fn rush(x: i32, y: i32) {
+ if x == 0 || y == 0 {
+ return ;
+ }
+
+ if x >= 1 {
+ print!("A");
+ }
+ for _ in 1..x - 1 {
+ print!("B");
+ }
+ if x >= 2 {
+ print!("C");
+ }
+ print!("\n");
+
+ for _ in 1..y - 1 {
+ print!("B");
+ for _ in 1..x - 1 {
+ print!(" ");
+ }
+ if x >= 2 {
+ print!("B");
+ }
+ print!("\n");
+ }
+
+ if y > 1 {
+ if x >= 1 {
+ print!("A");
+ }
+ for _ in 1..x - 1 {
+ print!("B");
+ }
+ if x >= 2 {
+ print!("C");
+ }
+ print!("\n");
+ }
+}
diff --git a/rush00/ex04/main.rs b/rush00/ex04/main.rs
new file mode 100644
index 0000000..fffd107
--- /dev/null
+++ b/rush00/ex04/main.rs
@@ -0,0 +1,17 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* main.rs :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/21 12:35:44 by charles #+# #+# */
+/* Updated: 2020/05/21 13:46:11 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+mod rush04;
+
+fn main() {
+ rush04::rush(5, 5);
+}
diff --git a/rush00/ex04/rush04.rs b/rush00/ex04/rush04.rs
new file mode 100644
index 0000000..dfe2cb6
--- /dev/null
+++ b/rush00/ex04/rush04.rs
@@ -0,0 +1,52 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* rush04.rs :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/05/21 13:44:52 by charles #+# #+# */
+/* Updated: 2020/05/21 13:45:31 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+pub fn rush(x: i32, y: i32) {
+ if x == 0 || y == 0 {
+ return ;
+ }
+
+ if x >= 1 {
+ print!("A");
+ }
+ for _ in 1..x - 1 {
+ print!("B");
+ }
+ if x >= 2 {
+ print!("C");
+ }
+ print!("\n");
+
+ for _ in 1..y - 1 {
+ print!("B");
+ for _ in 1..x - 1 {
+ print!(" ");
+ }
+ if x >= 2 {
+ print!("B");
+ }
+ print!("\n");
+ }
+
+ if y > 1 {
+ if x >= 1 {
+ print!("C");
+ }
+ for _ in 1..x - 1 {
+ print!("B");
+ }
+ if x >= 2 {
+ print!("A");
+ }
+ print!("\n");
+ }
+}
diff --git a/subjects/rush00.pdf b/subjects/rush00.pdf
new file mode 100644
index 0000000..dcd278f
--- /dev/null
+++ b/subjects/rush00.pdf
Binary files differ