3

I fail one test case, and just the one portion of it.

Expecting the following on standard out — xoqmd, rby gflkp!\n ... but received the following on standard out instead — xoqmd, szz gflkp!

rby =\= szz, and apparently no \n (not sure if that's my mistake or check50)

What would cause this? The letters for 'world' were ciphered correctly. 's' is +1,z is -2, z +1.... my vigenere key (j) only proceeds for an alphabetical character and the other tests pass. My guess is something with the ASCII math but what stumps me is that since other tests work, and the test I failed has non-isalpha included, the space/punct must be the problem... which I tried to test but can't discover an issue with either.

[code removed behind edit flag per academic honesty guidelines]

Note: don't believe my question was answered in other szz thread.

1 Answer 1

5
 world, say hello!
 bazba  zba zbazb
 =================
 xoqmd, rby gflkp!

You are doing this:

 world, say hello!
 bazbazbazbazbazb
 =================
 xoqmd, szz gflkp!

You are correctly skipping any non-alpha in the plaintext but you are still incrementing the key, because you have tied it to i which keeps incrementing even if the plaintext is non-alpha.

Think about incrementing j only when you use the key.

You must log in to answer this question.

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