0

[EDIT: Code removed for Honor Code compliance.]

The code seems to be running perfectly fine and gives the correct output But every time i try to check it, i get this:

:) mario.c exists
:( mario.c compiles
    code failed to compile
:| rejects a height of -1
    can't check until a frown turns upside down
:| rejects a height of 0
    can't check until a frown turns upside down
:| handles a height of 1 correctly
    can't check until a frown turns upside down
:| handles a height of 2 correctly
    can't check until a frown turns upside down
:| handles a height of 8 correctly
    can't check until a frown turns upside down
:| rejects a height of 9, and then accepts a height of 2
    can't check until a frown turns upside down
:| rejects a non-numeric height of "foo" 
    can't check until a frown turns upside down
:| rejects a non-numeric height of "" 
    can't check until a frown turns upside down
To see the results in your browser go to https://submit.cs50.io/check50/99bb52116361a4b77fd2f3696bebb9450bd29277

2 Answers 2

1

The code uses functions print and printf. While printf is part of standard C library, function print doesn't look to be such.

When you submit "mario.c" it gets compiled for evaluation purposes on another "machine". This way, if you are using functions which are not declared/defined in the "mario.c" or standard C library (e.g. your custom functions) they are not getting submitted which prevents program from being compiled successfully on another machine.

1
  • Sorry, that's not the problem. See my answer.
    – Cliff B
    Commented Jun 24, 2020 at 20:59
0

The code compiles and runs fine. It also works correctly when I run it with check50. Is it possible that you somehow deleted a semicolon before running check50? Or that you've been compiling one version of the code and check50 is accessing an earlier or different version of the source code file?

As for the print function, you correctly created it and included the function signature in the mario.c file. There's nothing wrong there.

Try running it all again, starting with recompiling in the IDE and testing it to make sure it still works for you.

IF it still isn't working, leave a comment and we can revisit.

2
  • So I tried using the check function of the same code in ide.cs50.io and it all worked perfectly fine. But everytime i try in the cs50 lab the error shows up. It's the same code and i tried recompiling but still the same outcome.
    – starbvuks
    Commented Jun 24, 2020 at 21:18
  • The lab is no longer being used in the course. Please use the IDE for your problem.
    – curiouskiwi
    Commented Jun 24, 2020 at 23:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .