Questions tagged [caesar]

Caesar Cipher, one of the assignments in Problem Set 2.

Filter by
Sorted by
Tagged with
5
votes
3answers
6k views

How to handle the lack of argv[1] in caesar?

I think my program handles lack of argv[1] correctly, yet it fails check50's test. here my code: if ( argc != 2 ) printf ("usage : ./caesar + key \n"); return 1;
0
votes
1answer
156 views

Caesar code fails check50

I've gone through a lot of the questions and tried that but it still fails the check50. I'll put the output here. :) caesar.c exists :) caesar.c compiles :( encrypts "a" as "b" using 1 as key \ ...
0
votes
1answer
324 views

CS50 Problem Set 2 - Caesar check error- I am unsure what is incorrect?

Here is my code below: #include <cs50.h> #include <stdio.h> #include <string.h> //strln #include <ctype.h> //upper lower etc #include <stdlib.h> //atoi int main (...
0
votes
1answer
106 views

I can't check my exercise (pset2, caesar)

I have a problem with ceasar. text of my code: #include <cs50.h> #include <stdio.h> #include <string.h> //desribe of values //int i - number of arguments //int n - lenght of ...
7
votes
4answers
6k views

What's the point of the modulo operation in the Caesar cipher formula?

According to the problem set specification, the formula for encrypting a message using the Caesar cipher is: ci = (pi + k) % 26 I don't get why you need to do modulo 26. What does it even do here?
3
votes
1answer
1k views

Why doesn't caesar pass check50 even though the output is correct?

I have solved caesar, but check50 is not recognizing my results as correct. :) caesar.c exists :) caesar.c compiles :( encrypts "a" as "b" using 1 as key \ expected output, but not "b" :( encrypts ...
1
vote
1answer
437 views

Pset 2 Caesar doesnt output spaces correctly and more :(

Really having a hard time doing this caesar problem my cipher text is not taking spaces to account and when I type in ./caesar by itself it gives me a message like this: caesar.c:10:18: runtime ...
1
vote
3answers
4k views

Segmentation fault (core dumped) in caesar

After starting caesar with an additional argument and providing the sentence that needs to be encrypted, the Terminal shows this response: jharvard@appliance (~/Dropbox/pset2): ./caesar 1 abcdef ...
0
votes
0answers
65 views

Please help, i keep hitting segmentation faults on this code

#include <stdio.h> #include <cs50.h> #include <ctype.h> #include <stdlib.h> #include <string.h> int main(int argc, string argv[]) { if ( argc > 2 || argc < 2 ) ...
0
votes
1answer
88 views

pset2 caeser boolean returns

when running the code below with a command line ./caesartest 2, I get the false return 1, not the true, what is wrong? (I began having the trouble after including isdigit)... #include <cs50.h> #...
0
votes
2answers
184 views

Caesar output extra characters in capitals only

My caesar code works well for lower case but adds extra characters for upper case even though I used the same strategy in coding. :( encrypts "BARFOO" as "EDUIRR" using 3 as a key \ expected output, ...