diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2023-12-03 10:08:21 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2023-12-03 10:08:21 +0000 |
commit | 36868e6ae9372e6e6dbf65cb5bb5f7f3aec041b4 (patch) | |
tree | 582b29c7ba09ba740e1d7ffd0b0233005372ffce /wk1/pset1/mario-more | |
parent | 9726d22aaa120ac19529d1185a9fd72f847b623a (diff) |
Sun, Dec 3, 2023, 2:08 AM -08:00
Diffstat (limited to 'wk1/pset1/mario-more')
-rw-r--r-- | wk1/pset1/mario-more/mario.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/wk1/pset1/mario-more/mario.c b/wk1/pset1/mario-more/mario.c index 4c15e38..b4fa540 100644 --- a/wk1/pset1/mario-more/mario.c +++ b/wk1/pset1/mario-more/mario.c @@ -27,16 +27,23 @@ void print_grid(size) { for (int i = 0; i < size; i++) { - for (int j = 0; j < size; j++) - { - if ((size - j) == 1) + for (int j = 0; j < size; j++) { - printf(" "); - } else { - printf("#"); + if ((size - (j + i)) > 1) + { + printf(" "); + } else { + printf("#"); + } + + /*if ((size - (j + i)) < 1) + { + printf(" "); + } else { + printf("#"); + }*/ } - } - printf("\n"); + printf(" "); } } |