diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2023-12-03 10:03:10 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2023-12-03 10:03:10 +0000 |
commit | 9726d22aaa120ac19529d1185a9fd72f847b623a (patch) | |
tree | 00a8e8933def302c21e296a0332e9729abccbfb7 /wk1/pset1/mario-more/mario.c | |
parent | 89bc1572902cf2081368ad755008a65bdedeff40 (diff) |
Sun, Dec 3, 2023, 2:03 AM -08:00
Diffstat (limited to 'wk1/pset1/mario-more/mario.c')
-rw-r--r-- | wk1/pset1/mario-more/mario.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/wk1/pset1/mario-more/mario.c b/wk1/pset1/mario-more/mario.c index 9ba12b8..4c15e38 100644 --- a/wk1/pset1/mario-more/mario.c +++ b/wk1/pset1/mario-more/mario.c @@ -19,7 +19,7 @@ int get_size(void) { n = get_int("Size: "); } - while (n < 1); + while (n < 1 || n > 8); return n; } @@ -29,8 +29,12 @@ void print_grid(size) { for (int j = 0; j < size; j++) { - if - printf("#"); + if ((size - j) == 1) + { + printf(" "); + } else { + printf("#"); + } } printf("\n"); } |