Questions tagged [pset2-vigenere]
The pset2-vigenere tag has no usage guidance.
27
questions
1
vote
1
answer
4k
views
Pset2 Vigenere: Control reaches end of non-void function
I´m trying to solve this pset but I got stuck with function declaration. I did everything according to the tutorial but the clang keeps showing an error: "control reaches end of non-void function" on ...
1
vote
1
answer
66
views
vigenere sometimes prints extra characters at the end of ciphertext in an unpredictable pattern
Check50 yields 2 error messages (the rest is correct):
:( encrypts "a" as "a" using "a" as keyword
output not valid ASCII text
:( encrypts "world!$?" as "xoqmd!$?" using "baz" as keyword
output not ...
0
votes
2
answers
82
views
PSET2 Vigenere: Output bug, keyword loop going over strlen of key
I am having an issue specifically with the second for loop (under "//iterate over key inputs" comment). The counter j is going over the strlen of argv[1], and thus feeding a wrong input to my shift ...
0
votes
1
answer
27
views
PSET 2; loop doesn't works like I want it to
Hi I have a problem with a loop
I want 22 line to 43 loop for the length of the text. But it only loops from 28 to 43. What am I doing wrong?
#import <stdio.h>
#import <cs50.h>
#include ...
0
votes
1
answer
23
views
Pset2 Vigenere some flaws in the code
I somehow managed to come up with this code to vigenere but it gives me 9/11 with check50. It encrypts it badly when using the keyword BaZ and BAZ. Why is that please?
And also I think I was supposed ...
0
votes
1
answer
175
views
PSET2 Vigenere: Control may reach end of non-void function error
I wrote a function to return the shift value for a certain character inputted. Where A, a = 0, B,b =1, etc.
int shift(char c)
{
int asc;
if (isupper(c))
{
asc = atoi(&c) - 65;...
0
votes
1
answer
38
views
Vigenère spitting out random strings
My vigenère is spitting out random strings. For example, here is a test I got from my terminal
~/pset2/ $ ./vigenere a
plaintext: a
ciphertext: G
~/pset2/ $
And my code is here. I suspect that ...
0
votes
1
answer
22
views
Can someone check my vigenere code. I just don't get the idea of index
for(int i=0; i<plain_len; i++)
{
int index = 0;
if(isalpha(plain_text[i]))
{
if (isupper(plain_text[i]))
{
printf ("%c", (...
0
votes
1
answer
897
views
Pset2 Vigenere: Pointers/Function Question
I've been having major trouble with Vigenere. I've worked on it every day for the passed two weeks and each day, I solve one problem but encounter another. I was able to get the program with the ...
0
votes
1
answer
42
views
CS50 Vigenere - Failure: "rejects "Hax0r2" as keyword" - Should be very quick and easy
I've checked my work, and I am failing the "Hax0r2" keyword test, but I cannot figure out why. My code is supposed to reject any argv[1] that is not all alphabetic characters. Will someone take a look ...
0
votes
1
answer
17
views
Pset 2 - Vigenere Wraparound does not work properly
As the title states, I'm using the modulo operator in order to loop back to the first letter of the key. I've ironed out all the other kinks within my code, however I still cannot get the key to ...
0
votes
1
answer
89
views
Pset3 help : vigenere error
I have this error.
Please Help
~/workspace/pset2/ $ make vigenere
clang -fsanitize=signed-integer-overflow -fsanitize=undefined -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wshadow ...
0
votes
2
answers
53
views
Pset 2 - vegenere
#include <cs50.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
bool isNumber(char number[]);
int main(int argc, string argv[])
{
// ...
0
votes
1
answer
54
views
Vigenere can't get correct output from key
I'm working on at least getting the key to apply the first go-around, then I will worry about how to wrap around the key. I'm outputting integers in the alphabetical index to keep it simpler.
Here is ...
0
votes
2
answers
141
views
Pset 2 - Vigenere Cipher Error: incompatible integer to pointer conversion, with a string/array element
I'm trying to use a function to change the command line argument into an an alphabetic index (like in caesar cipher) that I can then use, when converting the plaintext into ciphertext. Below's the ...
0
votes
0
answers
7
views
Vigenere don't encrypt the way I want
INPUT:
key: baz
plaintext: barfoo
OUTPUT:
expected ciphered_text_output: caqgon
My ciphered_text_output:: caqfgv
My code:
// Vigenère’s cipher improves upon Caesar’s cipher by encrypting messages ...
0
votes
1
answer
29
views
pset 2 Vigenere: actual output seems 2 characters off from 3rd plaintext character onwards
I've been stuck for so many hours on this, and need some advice :(
When I loop through the plaintext input, if the character contains a 'z' character then it outputs a '{' character. I've tried ...
0
votes
1
answer
31
views
pset2: "vigenere" missing output
when i use isString function or any function which containing "isalpha" function. My code provide missing output. When i remove isString function it works well. But i don't understand ...
0
votes
1
answer
57
views
How do you make a variable work in multiple loops?
I am trying to solve the vigenere.c problem, but there is one step that I need to figure out before my code works. I am stuck here and I don't know what else I could do. In my code, I have a variable ...
0
votes
1
answer
29
views
Pset2 Vigenere - encipher not working after wrap around
I seem to be very close as the ciphertext prints out fine until the string length of keyword is reached (example below). When running debugger the index "j" for my keyword "k" wraps around back to ...
0
votes
1
answer
33
views
Pset 2, Vigenere, Segmentation Fault - Finding Alpha - Better way to do this?
First time posting here. Still very much a beginner with this stuff. I spent more time than I care to admit recently trying to figure out how to get the command lines checks in vigenere to work. ...
0
votes
1
answer
44
views
PSet2 Vigenere issue: repeating ciphertext and spaces
I'm going through Vigenere right now, but I've run into 2 issues:
I can't seem to get my key to skip over spaces in the plaintext. I assigned two separate indices (i and j), but it seems to try to ...
0
votes
1
answer
51
views
Vigenere Cipher Printing Problem
I am wondering what this code is doing wrong when I run the keyword, "illuminatti," and the plaintext, "Magick is the key". I should get the ciphertext, "Ulrcos vs mam spj". I instead get the ...
0
votes
1
answer
194
views
pset 2 vigenere problem while executing :incompatible pointer to integer conversion passing 'string' (aka 'char *') to parameter of type 'int'
#include<stdio.h>
#include<cs50.h>
#include<ctype.h>
#include<string.h>
int check(string s); //user defined function to decide if the argv[1] ...
0
votes
1
answer
2k
views
pset2 vegenere - :( handles lack of argv[1] failed to execute program due to segmentation fault
#include <cs50.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
bool isNumber(char number[]);
int main(int argc, string argv[])
{
// ...
0
votes
1
answer
52
views
Vigenere unexpected output after length of key
I feel like I'm pretty close with this one, but I can't find where the wraparound is messing up. Any idea where I'm going wrong?
Expected:
$ ./vigenere ABC
plaintext: HELLO
ciphertext: HFNLP
Actual:...
0
votes
1
answer
47
views
Vigenere problem output
Hi I hope somebody can help! my program works fine but only when it gets to the end of the keyword it passes one character and doesn't print.
#include <stdio.h>
#include <cs50.h>
#include ...