summaryrefslogtreecommitdiff
path: root/wk1/pset1/mario-more
diff options
context:
space:
mode:
Diffstat (limited to 'wk1/pset1/mario-more')
-rw-r--r--wk1/pset1/mario-more/mario.c29
1 files changed, 12 insertions, 17 deletions
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(" ");