Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
| talit:planung_fs_2026_2m [2026-05-04 08:23] – [Mo. 04.05.2026] sca | talit:planung_fs_2026_2m [2026-06-08 11:15] (aktuell) – [Mo. 22.06.2026] sca | ||
|---|---|---|---|
| Zeile 79: | Zeile 79: | ||
| - Programmiere alle Klassen wie in der Übersicht gezeigt. Jede Child-Klasse (z.B. Student) soll von der entsprechenden Parent-Klasse (z.B. Person) erben. | - Programmiere alle Klassen wie in der Übersicht gezeigt. Jede Child-Klasse (z.B. Student) soll von der entsprechenden Parent-Klasse (z.B. Person) erben. | ||
| - | - Der Birthday soll im Datetime-Format und nicht als String gespeichert werden. | + | - Vererbung, Super: [[https:// |
| + | - Der Birthday soll im Datetime-Format und nicht als String gespeichert werden: | ||
| + | - Link: [[https:// | ||
| + | - Beispiele: | ||
| + | < | ||
| + | from datetime import datetime | ||
| + | birthday = datetime.strptime(" | ||
| + | birthday2 = datetime(2010, | ||
| + | print(birthday1.year) % zugreifen auf Datum | ||
| + | |||
| + | birthday.replace(year=birthday.year + 1) # Datum ändern | ||
| + | |||
| + | # Datum Unterschied | ||
| + | today = datetime.now() | ||
| + | delta = today - birthday | ||
| + | print(delta.days) | ||
| + | |||
| + | </ | ||
| - Füge den Klassen nun Methoden hinzu: | - Füge den Klassen nun Methoden hinzu: | ||
| - `get_age()`: | - `get_age()`: | ||
| - `increase_class()`. Erhöht die Klasse aller Students, aus " | - `increase_class()`. Erhöht die Klasse aller Students, aus " | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | |||
| + | **HA:** Klassen & Vererbung fertig, Birthday im DateTime-Format | ||
| + | |||
| + | |||
| === Mo. 11.05.2026 === | === Mo. 11.05.2026 === | ||
| - | * Auftrag: Game of Life wie vorgegeben mit OOP programmieren. | + | * Weiter an OOP |
| === PFINGSTFERIEN / WHITSUN HOLIDAYS === | === PFINGSTFERIEN / WHITSUN HOLIDAYS === | ||
| === Mo. 01.06.2026 === | === Mo. 01.06.2026 === | ||
| + | |||
| + | Game of Life mit OOP: | ||
| + | |||
| + | * Erinnerung: Klassen, Objekte, Methoden | ||
| + | * Auftrag in Gruppe: Auf Papier, Welche Klassen braucht es? Eigenschaften & Methoden? | ||
| + | * Zusammen besprechen. | ||
| + | |||
| + | |||
| === Mo. 08.06.2026 === | === Mo. 08.06.2026 === | ||
| + | |||
| + | Weiter an OOP GoL | ||
| + | |||
| + | **HA:** So weit wie möglich weiter coden | ||
| + | |||
| + | ++++Plan OOP GoL| | ||
| + | |||
| + | <code python> | ||
| + | World: | ||
| + | Properties: | ||
| + | - cells = [list of all alive cells and dead neighbours] | ||
| + | |||
| + | Methods: # Game Logic | ||
| + | - update # main method, triggers whole update procedure | ||
| + | - update_cells # move to next generation, remove all dead cells from cells-list | ||
| + | - count_alive_neighbours ... | ||
| + | - ... all other logic methods | ||
| + | |||
| + | |||
| + | Cell: | ||
| + | Properties: | ||
| + | - coordinates x,y (self.coordinats = [2,7] or self.x = 2, self.y = 7) | ||
| + | - is_alive_now = True / False | ||
| + | - is_alive_in_next_gen = True / False | ||
| + | - (neighbours = [list of Cells]) | ||
| + | |||
| + | Methods: None | ||
| + | |||
| + | (Logic:) | ||
| + | |||
| + | View: # Responsible for visualizing world on whatever device | ||
| + | Properties: | ||
| + | - nx (nr cells in x direction) | ||
| + | - ny (nr cells in y direction) | ||
| + | |||
| + | Methods: | ||
| + | - display / visualize: visualizes world on my screen | ||
| + | |||
| + | Model-View-Separation: | ||
| + | - not a single print, or pygame command, ... in Cell & World classes | ||
| + | - only in View-class | ||
| + | |||
| + | </ | ||
| + | |||
| + | ++++ | ||
| === Mo. 15.06.2026 === | === Mo. 15.06.2026 === | ||
| + | |||
| + | GoL mit OOP fertig! | ||
| + | |||
| + | |||
| === Mo. 22.06.2026 === | === Mo. 22.06.2026 === | ||
| + | |||
| + | AUSFALL | ||
| + | |||
| + | |||