From 2eb1402023e6c5fae07281f057ed52774371601b Mon Sep 17 00:00:00 2001 From: Awen Lelu Date: Tue, 6 Jan 2026 16:45:25 +0100 Subject: [PATCH] max hour setting --- main | Bin 16080 -> 16080 bytes main.cpp | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/main b/main index 478642e39039767775a77a955eb3d28b0409411b..108298bf70b95a5683f695f75035517069dccfd6 100755 GIT binary patch delta 208 zcmcamd!cp%2P3B{GXof?ZWd(p6J$)EoFEir&Oh%!>o@*+2RTlZaymBto!`dDQ0M5; zYZ}MPz_6c*fq}vBz>BoM|Nnb*yPin#&}LE9U|?V<)tdZDNJf}np24xVmhr{^fB*l# zKK?@D@Bjasd4yl^Y*J8QROVo0U|?|M6KG@d;AL~_XLjvlaqDGu?P2q7W@kFc#ly}K zxY=2;mxobe^F`g`OiUb%n`as9V`P+=9BDKi#QS8lkDYPFGXoe%ZWd(p6J*SooFEirQ76*+txmwPx0dmR|NsC0UrX@IyD%_# z^qR)Hx!Y_Cx zA7J9yq@cj4{2OG4BcDJUlLs%GQ$Mq7AB$Trt7{LNcQZTFAub+v4!_OLioHCHJex1- v9%o|u&9Hfv!9GStp2?9$(?PsXM*G+qXHVW}rO(MD3^I&?foJnetLMxB5&%B& diff --git a/main.cpp b/main.cpp index 20488fb..59b168c 100644 --- a/main.cpp +++ b/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);