From e4e284998484f54384c7d14d742786dafa21ef02 Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Mon, 4 Dec 2023 03:12:32 +0000 Subject: Sun, Dec 3, 2023, 7:12 PM -08:00 --- wk1/pset1/mario-more/mario.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'wk1') diff --git a/wk1/pset1/mario-more/mario.c b/wk1/pset1/mario-more/mario.c index 1b1fc83..4bc2183 100644 --- a/wk1/pset1/mario-more/mario.c +++ b/wk1/pset1/mario-more/mario.c @@ -31,27 +31,22 @@ void print_grid(size) { for (int j = 0; j < size; j++) { - if (x == 0) + if ((size - (j + i)) > 1) { - if ((size - (j + i)) > 1) - { - printf(" "); - } - else - { - printf("#"); - } + printf(" "); } else { - if ((size - (j + i)) > 1) ) - { - printf("#"); - } - else - { - printf(" "); - } + printf("#"); + } + } for (int j = size; j > 0; j--) { + if ((size - (j + i)) > 1) + { + printf("#"); + } + else + { + printf(" "); } } printf(" "); -- cgit v1.2.3