Skip to content

Commit 1f6e017

Browse files
committed
Add TODOs and update small things in slides
1 parent be54fed commit 1f6e017

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@ Familiarity with other programming languages will be beneficial but is not manda
2121
## Things to improve / TODOs
2222

2323
- more additional and optional tasks
24+
- struct initialization: how to access members? kommt theoretisch auf der nächsten Slide, aber vielleicht will man das früher?
25+
- ComplexNumber::norm lieber als Manhattan Norm implementieren?
26+
- Task 2, Schritt 4: Variablennamen tauschen, weil ist einfacher zum erklären
27+
- Meme beim Pattern Matching, lustiger werden
28+
- Option::nothing kompiliert nicht
29+
- Lernwochenende, Mittwoch
30+
- noch mehr Kontext zu dem Produktivcode, Anekdoten erhöhen
31+
- zu wenig Tutoren

slides/slides.pdf

0 Bytes
Binary file not shown.

slides/slides.typ

+7-8
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@
237237
}
238238
239239
fn norm(self) -> f64 {
240-
let squared_norm = self.real.powi(2) + self.imaginary.powi(2);
241-
squared_norm.sqrt()
240+
self.real.abs() + self.imaginary.abs()
242241
}
243242
```
244243
]
@@ -262,8 +261,8 @@
262261

263262
#text(size: 21pt)[
264263
```rust
265-
trait Add {
266-
fn add(self, other: Self) -> Self;
264+
trait MyAdd {
265+
fn my_add(self, other: Self) -> Self;
267266
}
268267
```
269268
]
@@ -274,8 +273,8 @@
274273

275274
#text(size: 21pt)[
276275
```rust
277-
impl Add for ComplexNumber {
278-
fn add(self, other: Self) -> Self {
276+
impl MyAdd for ComplexNumber {
277+
fn my_add(self, other: Self) -> Self {
279278
Self {
280279
real: self.real + other.real,
281280
imaginary: self.imaginary + other.imaginary,
@@ -468,7 +467,7 @@
468467
+ Refactor ```rust PixelColor::new()``` to return ```rust Result<Self, String>```
469468
- ```rust new()``` should return ```rust Err``` if a color channel is ```rust < 0``` or ```rust > 1```
470469
- ```rust String``` represents an error message e.g., ```rust String::from("foo")```
471-
+ Change return type of ```rust main()``` to ```rust Result<(), String>``` and ```rust return Ok(())```
470+
+ Change return type of ```rust main()``` to ```rust Result<(), String>``` and return ```rust Ok(())```
472471
+ Handle the result of ```rust PixelColor::new()``` with pattern matching
473472
- Save ```rust Ok``` in the variable
474473
- Print ```rust Err``` message and return error from ```rust main()```
@@ -621,7 +620,7 @@
621620
- Store red pixel if ```rust x == y```, else black
622621
- Create an image of size 20x10 in ```rust main()``` using this function
623622
+ ```rust fn is_red(self) -> bool``` should now take ```rust self``` by reference (```rust &self```)
624-
+ Iterate over pixels by index, find red pixels, store them in a collection
623+
+ Create new function, iterate over pixels by index, find red pixels, store them in a collection
625624
- ```rust fn get_red_positions(image: &Vec<Vec<PixelColor>>) -> Vec<(usize, usize)>```
626625
+ Add ```rust #[derive(Debug)]``` to ```rust PixelColor```
627626
+ Use ```rust dbg!(positions);``` to print the resulting collection

0 commit comments

Comments
 (0)