- This topic is empty.
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
Software programming learning aide
CS50 threads to aide as a supplementary resource › Forums › CS50’s Introduction to Computer Science by Harvard University on Edx › Week 2 › Attributing keys to alphabets
Tagged: substitution project
Reply
Consider the key as the new alphabet! If plaintext is “E” then find the corresponding letter in the new alphabet. Since letter E is the 5th letter in the old alphabet then find the 5th letter in the new one, in your example that will be letter T.
You did the other way around, looking for E’s position in the key (3rd letter in key) and matching with third letter in alphabet.
From instructions:
“A key, for example, might be the string NQXPOMAFTRHLZGECYJIUWSKDVB. This 26-character key means that A (the first letter of the alphabet) should be converted into N (the first character of the key), B (the second letter of the alphabet) should be converted into Q (the second character of the key), and so forth”
Query
Does it mean that initially an array is created of size 27 with argv[1][0] = A…
The key entered: NQXPOMAFTRHLZGECYJIUWSKDVB.
A = argv[1][0] = N
B = argv[1][1] = Q
C = argv[1][2] = X
…………………
Z = argv[1][25] = B
Reply
Does it mean that initially an array is created of size 27 with argv[1][0] = A…
I don’t know exactly what you mean by this? If you are thinking about the alphabet you can check the ASCII table. Find ‘a’ and ‘A’ and see how you can relate a letter’s ASCII value to a position in the alphabet.[learn_press_profile]