max hour setting
This commit is contained in:
3
main.cpp
3
main.cpp
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user