jharvard@appliance (~/Dropbox/pset1): make mario
clang -ggdb3 -O0 -std=c99 -Wall -Werror mario.c -lcs50 -lm -o mario
jharvard@appliance (~/Dropbox/pset1): check50 2014/x/pset1/mario mario.c
:) mario.c exists
:) mario.c compiles
:) rejects a height of -1
:( handles a height of 0 correctly
\ expected an exit code of 0, not output of "##"
:( handles a height of 1 correctly
\ expected output, but not "##\n ###\n ####\n"
:( handles a height of 2 correctly
\ expected output, but not "##\n ###\n ####\n"
:( handles a height of 23 correctly
\ expected output, but not "##\n ###\n ####\n"
:( rejects a height of 24
\ expected prompt for input, not exit code of 0
:) rejects a non-numeric height of "foo"
:) rejects a non-numeric height of ""
https://sandbox.cs50.net/checks/d7edbb66e9b94346accb91ee8b13e9e4
jharvard@appliance (~/Dropbox/pset1):
Part of my mario.c listing
for (i = 0; i < 8; i++)
printf(" ");
for (i = 0; i < 2; i++)
printf("#");
for (m = 0; m < 1; m++)
printf("\n");
for (i = 0; i < 7; i++)
printf(" ");
for (i = 0; i < 3; i++)
printf("#");
printf("\n");
for (i = 0; i < 6; i++)
printf(" ");
for (i = 0; i < 4; i++)
printf("#");
printf("\n");
When I tried use printf("\n")
to move to the next line , I have \n
printed in my output instead of moving to the next line. I tried using a single line for loop to move to the next line. Still it prints a \n
instead of new line. Obviously I am doing something wrong.
I looked at the earlier questions on this topic listed below. I am going round in circles with this and some other input logical error. Can somebody help me?
For Honor code reasons, I listed only part of my code. If somebody requires my complete listing to help me, if they have a reddit account or private Email, I can send my complete listing of the code to them.
Earlier questions on the similar topic listed below: