max hour setting

This commit is contained in:
Awen Lelu
2026-01-06 16:45:25 +01:00
parent fa90ec3dae
commit 2eb1402023
2 changed files with 2 additions and 1 deletions

BIN
main

Binary file not shown.

View File

@@ -5,6 +5,7 @@
const int base_zombies = 3;
const int base_humans = 10000;
const int max_hours = 100000;
const int attack_chance = 80;
const int infection_chance =
@@ -37,7 +38,7 @@ void loop(int hour, int humans, int zombies) {
}
}
if (new_humans <= 0 || new_zombies <= 0) {
if (new_humans <= 0 || new_zombies <= 0 || hour >= max_hours) {
std::printf("finito pipo");
} else {
loop(hour+1, new_humans, new_zombies);