Questions tagged [cipher-pset2]
The cipher-pset2 tag has no usage guidance.
20
questions
1
vote
1answer
125 views
Pset2 Caesar: extra letter printed at the end of ciphertext
I have test many cases and most of them are fine except the following one:
~/workspace/pset2/caesar/ $ ./caesar 2
plaintext: I love tea
ciphertext: K nqxg vgcB
Where does the extra letter "B" come ...
0
votes
1answer
33 views
I'm stuck at PSet 2 Caesar Cipher: The alphabets don't follow my modulo 26. It goes beyond it, printing non-alphabetic characters
The crux is at the last part where I've commented "CONVERT PLAINTEXT TO CIPHERTEXT"
The variable asciiValue holds the, well, the asciiValue of the enciphered character. As you can see, I've ...
0
votes
1answer
88 views
Caesar - Problem set 2 - incorrect output
include // isalpha, isupper, islower - functions needed for caesar --- c = (p + k) %26
include // Check program is ran with only 1 command line arg. Check to make sure all characters are digits.
...
0
votes
1answer
949 views
pset2//caesar- relational operator result unused error
my code-->
#include<stdio.h>
#include<cs50.h>
#include<string.h>
#include<ctype.h>
#include<stdlib.h>
int main(int argc, string argv[])
{
if(argc!=2)
...
0
votes
2answers
39 views
pset2 caesar please help
Can someone please point me in the right direction to correct this code? i am getting blank results when entering a lowercase letter. Thanks!
#include <stdio.h>
#include <cs50.h>
#include ...
0
votes
1answer
310 views
pset2 caesar alphabet loop
In light of CS50's plagiarism rules I'll do this in part psuedo code. My question lies within the for loop that iterates through the user's input to translate it into Caesar's cipher. For some reason, ...
0
votes
1answer
63 views
Vigenere code still rotates for nonalpha
I've been trying to get my vigenere straight for some time now, managed to get rid of most of the bugs, but all I can see is that it still rotates the code for me even when I have a non-alpha ...
0
votes
1answer
31 views
Testing code to validate input using a parenthesis for cs50/pset 2/caesar.c I get error bash: syntax error near unexpected token `)'
Been struggling with this all morning and grateful for any help please!
I'm aware that it's not the most elegant code but below weems to work OK with most invalid input that I've thrown at it so far, ...
0
votes
0answers
29 views
Caesar (Pset2): When i print out ciphertext, some additional characters, that are not supposed to be part of the array, print out. How do i fix that? [duplicate]
// Receive plaintext
string text = get_string("plaintext: ");
int t = strlen(text);
char ciphertext[t];
//Array assignment
for (int i = 0; i < t; i++)
{
// Plaintext to Ciphertext
...
0
votes
1answer
144 views
vigenere pset2 spaces
I'm having issues figuring out how to ignore the spaces in the user string when changing to ciphertext. I thought the isalpha() check accounted for that but I guess not.
Any help would be ...
0
votes
1answer
47 views
Pset2 Caesar Hail dont know how to encrypt the plaintext
plz help me refine my code thxļ¼ļ¼
https://raw.githubusercontent.com/check50/davil3388/cs50/2017/fall/caesar/caesar.c?token=Aehv0R6qUjbNWPi_rOMKjS7ChP3tSlW1ks5aSK8MwA%3D%3D
0
votes
1answer
40 views
pset2 caesar, I really dont know, its printing the first capital twice?
im stuck now, I cant see it. Its all working and ciphers correctly, but whenever the first index of plaintext is a capital, it seems to print it twice?
I have gone through it line by line for ages ...
0
votes
1answer
21 views
working with vigenere cipher
below is my vigenere code, it sorts of prints just the first character of the string input and it gets stuck after that for some reason I can seem to figure out.
#include <stdio.h>
#include <...
0
votes
2answers
135 views
pset-2, caesar { key input-help needed}
when i take the command line input (the key) from the user, how do i store it?
the argv[1] (this variable will be clear if you read my code )which the user will provide is supposed to be an integer ...
0
votes
1answer
25 views
working with vigenere 2
Below is my vigenere code for enciphering text, but the enciphering key does not wraparound.
/* a program, vigenere, that encrypts messages using Vigenereās cipher*/
#include <stdio.h>
#...
0
votes
0answers
47 views
wrapping around in vigenere cipher
Below is my vigenere code for enciphering text, but the enciphering key does not wraparound.
/* a program, vigenere, that encrypts messages using Vigenereās cipher*/
#include <stdio.h>
#...
0
votes
1answer
45 views
pset2 letter repetition
For the input:
./caesar 23
!!!!AAAAGGGGG!!!!
it prints !!!!XXXXXXXXX!!!
So the first letter is repeated :0
So why is that happening,
What is the reason of repetition!!
...
-btw- code is incomplete....
0
votes
1answer
94 views
Problem Set 2: Vigenere's Cipher
I implemented the check50 to check the correctness of my vigenere's cipher program and received the following prompt:
:( rejects "Hax0r2" as keyword
\ expected output, not a prompt for input
What ...
0
votes
2answers
86 views
ceasar cs50 algorithm problem
i am having problem in making the final enciphering equation. actually i am confused with this ASCII part. not asking for code . just a helpful understanding of this ASCII part.
0
votes
2answers
312 views
Hax0r2 case-vigenere cipher
My program passes all the tests in the check50 except for the case dealing with Hax0r2 input i.e key word containing nonalphabetical characters. Check test results are included below.
:) vigenere.c ...