From 896226f67f4d099de8fbf2dab1f5267e89c1d8c7 Mon Sep 17 00:00:00 2001 From: Valentin Moguerou Date: Wed, 6 Oct 2021 21:13:55 +0200 Subject: [PATCH] Clarifying the syntax --- src/route.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/route.c b/src/route.c index 09cc7cc..76877c0 100644 --- a/src/route.c +++ b/src/route.c @@ -203,8 +203,12 @@ void generate(route *rt) { directions *dirs = init_directions(rt); - for (int i=0; i < RANDINT(1, rt->width*rt->width) && evaluate_directions(dirs); i++) + for (int i=0; i < RANDINT(1, rt->width*rt->width); i++) { + if (!evaluate_directions(dirs)) + { + break; + } push_choose(rt, dirs); } -} \ No newline at end of file +}