Questions tagged [key]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
39 views

Print keys of CSV files in DNA pset6

I want to see what the keys of the reader dictionary are so I use the print(key) function. The result is all the lines of the dictionary. Why is that? import csv from sys import argv, exit # Check if ...
0
votes
1answer
326 views

PSet 2: Caesar, validating key

I'm struggling with the output to the "Validating Caesar's Key" part of PSet 2. First-timer here, like many, and appreciative of any insight. When I compile and then run this program with "./caesar 2",...
1
vote
1answer
198 views

Key looping in Vigenere

I've reached the final step of Vigenere, but I don't really understand how do I loop the key over plaintext. This is the shift function I've created: int shift(char c) { if(isalpha(c)) { ...
0
votes
1answer
44 views

Pset 2 Vigenere

For capital letters the key seems to be behind my -6. Such that A is -6 and F is zero. :(
0
votes
1answer
275 views

PSET 2 Caesar: Help getting key from user (one line)

I am currently on CS50x’s PSET2, Caesar, trying to get a key from the user (the first step pretty much). I need to get the key from the user. I understand that it will be a string stored in argv2 and ...
0
votes
1answer
50 views

vigenere problem with key, the program sees the key as only one number

When I run my code with the key it ciphers strangely: $ ./vigenere ftskfpg plaintext: aaaaaaa ciphertext: ggggggg I don't really understand why it does it, I made a loop for a key and for the ...
0
votes
1answer
42 views

Vigenere working unless there's an 'a' in the key. Please help!

I've been at this for 2 days now and am completely stumped at this point. Absent of an 'a' (or 'A') in the key, the program works exactly as intended. If an 'a' is included in the key, however, the ...
0
votes
1answer
160 views

cs50 pset2/vigenere - code doesn't work if text and key differ upper/lower case

I Don't know how to make code work if key is lowercase and text uppercase and vice-versa. Before I considered case sensitivity my code would work except for a few letters. Now it wont output full ...
0
votes
2answers
116 views

cs50/pset2/vigenere why can't my code handle a key world of Hax0r2? code works otherwise

My code works properly, except that it doesn't reject numeric key. I try using an if statement to validate input key as follow: int main (int argc, string argv[]) { if((argc != 2) || (isalnum(...
0
votes
1answer
110 views

pset7: portfolio table gives error

I'm following the instructions in pset7's page, and I have to give users free shares, by inserting a new table in portfolios. However, i get this error: #1062 - Duplicate entry '1' for key 'PRIMARY' ...
0
votes
2answers
102 views

PSET 2 Vigenere - problem

My code works with a Key of BBB and the letters AAA and loops properly and skips spaces, numbers, punctuation but fails the tests. With a key of baz, it turns world say hello to xpsme, tbz ifmmp and ...
0
votes
1answer
44 views

vigenere set key values not working

This is the code I am using to change the string key into their respective shift values. For some reason as I have put a printf to test this, it outputs some weird strings of numbers. int k[strlen(c)]...
0
votes
1answer
89 views

Vigenere - how to apply local variable in key to secret message

I've been a bit stuck in trying to solve this problem involving changing the key from one letter to the next. I haven't gotten to wrap around the key yet. I think I know what the problem is but need ...
0
votes
1answer
203 views

pset2 Vigenere: Problems Applying Key & Case

for (int i = 0, n = strlen(p); i < n; i++) { if (isalpha(p[i])) { if (isupper(p[i])) { char stringshifttext = ((((p[i] - 'A') + (k[i % strlen(k)] - 'A')) % 26) ...
1
vote
1answer
464 views

Vigenere key counts spaces in progression

Whenever I type plaintext into my vigenere cipher, it moves forward one letter when it encounters spaces or punctuation, even though the key does not affect those characters. How can I prevent this? ...
0
votes
2answers
49 views

Incorrect results when the key has fewer letters than GetString

The title says it all, I can't get my key to repeat itself correctly after one repetition. For example, if my key is 3 letters and GetString is 6, then the last3 letters of GetString will be ...
0
votes
1answer
75 views

How can I display “< key>” on the same line if argc != 2?

How can I display "< key>" on the same line if argc != 2? Example: check50 2014.fall.pset2.caesar caesar.c
0
votes
1answer
70 views

compare value to key (dropoff)

For dropoff() in my pset8 code I'm stuck at the following line //find house in range for (var i in HOUSES) if in range // iterate over seats for (var j in shuttle....