jem: some progress
This commit is contained in:
parent
f0c5dd323f
commit
b8282a4d0c
7 changed files with 80 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
*.lock
|
||||
**/target/*
|
6
Cargo.toml
Normal file
6
Cargo.toml
Normal file
|
@ -0,0 +1,6 @@
|
|||
[workspace]
|
||||
resolver = "2"
|
||||
members = [
|
||||
"jem/hello_cargo",
|
||||
"jem/guessing_game",
|
||||
]
|
6
jem/guessing_game/Cargo.toml
Normal file
6
jem/guessing_game/Cargo.toml
Normal file
|
@ -0,0 +1,6 @@
|
|||
[package]
|
||||
name = "guessing_game"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
15
jem/guessing_game/src/main.rs
Normal file
15
jem/guessing_game/src/main.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
use std::io;
|
||||
|
||||
fn main() {
|
||||
println!("Rate die Zahl!");
|
||||
|
||||
println!("Bitte gib deine Schätzung ein.");
|
||||
|
||||
let mut guess = String::new();
|
||||
|
||||
io::stdin()
|
||||
.read_line(&mut guess)
|
||||
.expect("Fehler beim Lesen der Zeile");
|
||||
|
||||
println!("Du hast geschätzt: {guess}");
|
||||
}
|
6
jem/hello_cargo/Cargo.toml
Normal file
6
jem/hello_cargo/Cargo.toml
Normal file
|
@ -0,0 +1,6 @@
|
|||
[package]
|
||||
name = "hello_cargo"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
3
jem/hello_cargo/src/main.rs
Normal file
3
jem/hello_cargo/src/main.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
42
jem/session-2025-03-14.md
Normal file
42
jem/session-2025-03-14.md
Normal file
|
@ -0,0 +1,42 @@
|
|||
# 2025-03-14
|
||||
|
||||
## erste schritte
|
||||
|
||||
### installation
|
||||
|
||||
1. wie mach ich das in einem container?
|
||||
2. mein rust-analyzer findet kein projekt?
|
||||
|
||||
```bash
|
||||
rustup component add rustfix
|
||||
rustup component add clippy
|
||||
```
|
||||
|
||||
### vscodium
|
||||
|
||||
1. Multiroot - wie ? Schon war ein Besuch beim betreffenden PR nötig ... ;-()
|
||||
|
||||
|
||||
### cargo
|
||||
|
||||
1. oh nein - toml & crates ...
|
||||
|
||||
## Guessing Game
|
||||
|
||||
1. was ist ein prelude ?
|
||||
2. lib reference hat module / description zuklappen / stdin()
|
||||
3. Fkt mit Nebenwirkungen haben ein `!` ? :-)
|
||||
4. mut = mutable :-)
|
||||
1. `&mut guess` vs `&guess` :-)
|
||||
5. assoziierte Funktion (String::new) == objektorientiert?
|
||||
6. behandlung v. fehlern wir nicht erzwungen - nur gewarnt ??
|
||||
|
||||
## wichtige tools
|
||||
|
||||
1. `rustfmt *.rs`: https://rust-lang-de.github.io/rustbook-de/appendix-04-useful-development-tools.html
|
||||
2. `rustfix `
|
||||
3. `cargo` : https://doc.rust-lang.org/cargo/
|
||||
|
||||
## wichtige Referenzen
|
||||
|
||||
1. Std lib: https://doc.rust-lang.org/stable/std/
|
Loading…
Add table
Reference in a new issue