Rust lernen (Teil 2): Typen und Kontrollfluss
Only available in German.
Ganzzahlen mit fester Breite, Überlauf, Division ohne stille Umwandlung und if und loop als Ausdrücke. Am Ende liest logbuch den Statuscode jeder Zeile und zählt die Fehler.
ls -lt posts/ | grep #tutorial
Only available in German.
Ganzzahlen mit fester Breite, Überlauf, Division ohne stille Umwandlung und if und loop als Ausdrücke. Am Ende liest logbuch den Statuscode jeder Zeile und zählt die Fehler.
Only available in German.
Rust installieren, das erste Cargo-Projekt anlegen und die ersten Fehlermeldungen lesen. Am Ende zählt logbuch die Zeilen einer Logdatei, mit drei grünen Tests.
Only available in German.
Zum Abschluss: nützliche Module aus der Standardbibliothek, Generatoren, Decorators und der Ausblick auf Type Hints, Tests, Packaging und async.
Only available in German.
Code auf mehrere Dateien aufteilen: eigene Module, import, der __main__-Block, klare Verantwortlichkeiten – plus ein erster Einstieg in venv und pip.
Only available in German.
Dateien lesen und schreiben mit with, pathlib und JSON – damit der Dungeon seinen Spielstand speichern und später wiederherstellen kann.
Only available in German.
Exceptions verstehen und gezielt behandeln: try, except, else, finally, eigene Fehlerklassen und EAFP – damit der Dungeon auf ungültigen Input reagiert, statt abzustürzen.
Classes bundle state and behavior: players, rooms, and items become objects with their own attributes and methods.
Comprehensions, slicing, enumerate, zip, unpacking, and truthiness: these idioms make our Python code more compact, clearer, and easier to read.
Functions break code into named, reusable blocks. With parameters, return values, and scope, our game loop becomes easy to follow again.
Lists, tuples, dictionaries, and sets: with them, we describe the dungeon world as data and give our adventurer a real inventory.