diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..105ce2d
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..6d3cbac
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/prog a 3.iml b/.idea/prog a 3.iml
new file mode 100644
index 0000000..0070e87
--- /dev/null
+++ b/.idea/prog a 3.iml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..fec9282
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,254 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+ "associatedIndex": 7
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1760449575234
+
+
+ 1760449575234
+
+
+
+
+
+
+
+
+
+
+ 1761661518284
+
+
+
+ 1761661518284
+
+
+
+ 1761661723912
+
+
+
+ 1761661723912
+
+
+
+ 1761666882586
+
+
+
+ 1761666882586
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Hausaufgaben/Ha4/K-Länge.py b/Hausaufgaben/Ha4/K-Länge.py
new file mode 100644
index 0000000..3e07cc8
--- /dev/null
+++ b/Hausaufgaben/Ha4/K-Länge.py
@@ -0,0 +1,3 @@
+words = ["Apfel", "Banane", "Kirsche", "Kiwi", "Melone"]
+pri=sum(len(word) for word in words if word.startswith("K"))
+print(pri)
\ No newline at end of file
diff --git a/Hausaufgaben/Ha4/UndoDoodle.py b/Hausaufgaben/Ha4/UndoDoodle.py
new file mode 100644
index 0000000..6061998
--- /dev/null
+++ b/Hausaufgaben/Ha4/UndoDoodle.py
@@ -0,0 +1,58 @@
+import pygame
+from game import Game
+
+class DrawGame(Game):
+ def __init__(self):
+ super().__init__("Zeichenprogramm", fps=60, size=(800, 600))
+ self.state = []
+ self.history = []
+ self.drawing = False
+ self.current_stroke = []
+
+ def handle_event(self, event):
+ if event.type == pygame.QUIT:
+ return False
+
+ elif event.type == pygame.MOUSEBUTTONDOWN and event.button == 1:
+ self.drawing = True
+ self.current_stroke = [event.pos]
+
+ elif event.type == pygame.MOUSEBUTTONUP and event.button == 1:
+ if self.drawing and len(self.current_stroke) > 1:
+ self.push_history()
+ new_state = [stroke[:] for stroke in self.state]
+ new_state.append(self.current_stroke[:])
+ self.state = new_state
+ self.drawing = False
+ self.current_stroke = []
+
+ elif event.type == pygame.MOUSEMOTION and self.drawing:
+ self.current_stroke.append(event.pos)
+
+ elif event.type == pygame.KEYDOWN and event.key == pygame.K_BACKSPACE:
+ if self.history:
+ self.state = self.history.pop()
+
+ return True
+
+ def push_history(self):
+ snapshot = [stroke[:] for stroke in self.state]
+ self.history.append(snapshot)
+ if len(self.history) > 5:
+ self.history.pop(0)
+
+ def draw_game(self):
+ self.screen.fill((255, 255, 255))
+
+ for stroke in self.state:
+ if len(stroke) > 1:
+ pygame.draw.lines(self.screen, (0, 0, 0), False, stroke, 2)
+
+ if self.drawing and len(self.current_stroke) > 1:
+ pygame.draw.lines(self.screen, (0, 0, 0), False, self.current_stroke, 2)
+
+ pygame.display.flip()
+
+
+if __name__ == "__main__":
+ DrawGame().run()
diff --git a/Hausaufgaben/Ha4/args.py b/Hausaufgaben/Ha4/args.py
new file mode 100644
index 0000000..a936b71
--- /dev/null
+++ b/Hausaufgaben/Ha4/args.py
@@ -0,0 +1,6 @@
+t = (1, 2, 3)
+
+print(t)
+print(*t)
+print(t, 4)
+print(*t, 4)
diff --git a/Hausaufgaben/Ha4/timing-Decorator.py b/Hausaufgaben/Ha4/timing-Decorator.py
new file mode 100644
index 0000000..50ad02d
--- /dev/null
+++ b/Hausaufgaben/Ha4/timing-Decorator.py
@@ -0,0 +1,24 @@
+from time import perf_counter as pfc
+from functools import wraps
+
+def timing(func):
+ @wraps(func)
+ def wrapper(*args, **kwargs):
+ start = pfc()
+ result = func(*args, **kwargs)
+ end = pfc()
+ print(f"Dauer: {end - start:.4f}s")
+ return result
+ return wrapper
+
+
+@timing
+def meine_funktion(n):
+ total = 0
+ for i in range(n):
+ total += i
+ return total
+
+
+ergebnis = meine_funktion(1000000)
+print("Ergebnis:", ergebnis)
\ No newline at end of file