0

I'm making my way through Caesar.c in PSet2, and am struggling to overcome all these check50 issues. They look identical to me, but I'm sure I made some sort of mistake. Let me know if seeing some code would help. I am a bit confused how this is possible. Thanks!

Edit: Check50 fails with both "ciphertext: " printed before the output (matching the PS requirements) and without (matching the Check50 requirements).

Edit Edit: Was missing the new line after output. Thanks Dino!

:) caesar.c exists
:) caesar.c compiles
:( encrypts "a" as "b" using 1 as key
   \ expected output, but not "b"
:( encrypts "barfoo" as "yxocll" using 23 as key
   \ expected output, but not "yxocll"
:( encrypts "BARFOO" as "EDUIRR" using 3 as key
   \ expected output, but not "EDUIRR"
:( encrypts "BaRFoo" as "FeVJss" using 4 as key
   \ expected output, but not "FeVJss"
:( encrypts "barfoo" as "onesbb" using 65 as key
   \ expected output, but not "onesbb"
:( encrypts "world, say hello!" as "iadxp, emk tqxxa!" using 12 as key
   \ expected output, but not "iadxp, emk tqxxa!"
:) handles lack of argv[1]
https://sandbox.cs50.net/checks/44d80aa1ba9b45fa9988bb4b4bb71bbb

results with ciphertext included so it matches the PS requirements, but not the Check50 quotes.

:) caesar.c exists
:) caesar.c compiles
:( encrypts "a" as "b" using 1 as key
   \ expected output, but not "ciphertext: b"
:( encrypts "barfoo" as "yxocll" using 23 as key
   \ expected output, but not "ciphertext: yxocll"
:( encrypts "BARFOO" as "EDUIRR" using 3 as key
   \ expected output, but not "ciphertext: EDUIRR"
:( encrypts "BaRFoo" as "FeVJss" using 4 as key
   \ expected output, but not "ciphertext: FeVJss"
:( encrypts "barfoo" as "onesbb" using 65 as key
   \ expected output, but not "ciphertext: onesbb"
:( encrypts "world, say hello!" as "iadxp, emk tqxxa!" using 12 as key
   \ expected output, but not "ciphertext: iadxp, emk tqxxa!"
:) handles lack of argv[1]
https://sandbox.cs50.net/checks/89ea882d571a4b3bad9cd9d541cfa457
2
  • 2
    Possible duplicate of Caesar code fails check50 May 25, 2017 at 21:23
  • Hi thanks for the reply. That does not seem to be the case. Both plaintext and ciphertext are printing as necessary and don't effect the Check50 results.
    – TroyHP
    May 25, 2017 at 21:40

1 Answer 1

1

Based on the sandbox link, it looks like you are missing the terminating new line as required by the spec:

After outputting ciphertext, you should print a newline. Your program should then exit by returning 0 from main.

sandbox left side: Expecting the following on standard out —ciphertext:\s*b\n

sandbox right side: ... but received the following on standard out instead —ciphertext: b

1
  • You're right that was the problem. Thanks for the help!
    – TroyHP
    May 25, 2017 at 21:52

You must log in to answer this question.

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