This seems to be a faq on this problem set, although I looked at all other answers that pertained to this problem, I have been unable to fix the error. I am having trouble with one check50 spec where by using "baz", for "World, say hello", I am getting out "xoqmd, szz gflkp". I know the problem is due to the fact that the key is incrementing with i
, and fails to skip none alpha chars. I know to fix this I have to create a separate index for j
, and increment when i
is alpha. But i
I don't know how to do that, I have tried everything and nothing seems to work.
1 Answer
This is a common question. Over in the subreddit, I posted a thread: "thinking about vigenere and nested loops... Perhaps that would give you a hint on how to handle more than one counter, with one that only increments some of the time.
i
(which I assume keeps track of the current character in the plain text). what's difficult about that? what have you tried so far?