This commit is contained in:
Auric Vente
2024-07-21 05:50:25 -06:00
parent 34896e24e2
commit 3d8ff1f167
4 changed files with 67 additions and 34 deletions

View File

@@ -273,10 +273,19 @@ class Game:
@staticmethod
def restart() -> None:
def action() -> None:
Ants.clear()
Window.clear_view()
Ants.fill()
Game.start_loop()
opts = ["25", "50", "100", "200", "300", "400", "500"]
opts = [f"{opt} ants" for opt in opts]
size = Window.prompt_combobox("Size of the population", opts, 2)
Window.confirm("Restart the ants?", action)
if not size:
return
num = int(size.split(" ")[0])
Window.clear_view()
Ants.populate(num)
Game.start_loop()
@staticmethod
def update_size() -> None:
pass