Skip to main content

Questions tagged [caesar]

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

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

Expected identifier or '(' caesar

I am just starting the caesar problem set, and I have already run into a problem. Just to start off with, I wanted to create a clause where the program would output 'error' if argc was not equal to 2, ...
Daniel Hill's user avatar
0 votes
1 answer
14 views

caesar returning [encrypted string]PACHE_PID_FILE=/home/ubuntu/lib/apache2/run/apache2.pid

This piece of code: for (int i = 0; i < strlen(plain); i++) { if (plain[i] >= 'A' && plain[i] <= 'Z') { chiper[i] = (((plain[i] + move) - 64) % 26) + 64; } ...
Mark Cangila's user avatar
0 votes
3 answers
156 views

PSET2 caesar wont compile, keep getting error "expected exit 0 not 1"

My program runs correctly, just wont compile. I've tried everything i can think of. In other similar questions asked it was brought up that there is a bug with the check50 function... My CS50 ide is ...
Craig Stevens 's user avatar
4 votes
1 answer
2k views

pset6 - caesar - check50 error: "expected exit code 1, not 0"

I scored the web after an answer, found it, but still doesn't work. My caesar.py works fine, check50 shows me all happy faces except the last: :( handles lack of argv[1] expected exit code 1, not ...
Daniel da Rocha's user avatar
0 votes
1 answer
310 views

Caesar check50 fail

Just trying to finish the Caesar problem please see my code below: // INCLUDE THE APPROPRIATE LIBRARIES #include <math.h> #include <cs50.h> #include <stdio.h> #include <string.h&...
Pot Noodle's user avatar
0 votes
1 answer
171 views

Pset 2( 2 Questions) Caesar

it is about pset 2 caesar.c Question 1: Do I need to consider the case when the user input something after ./caesar (argv [1]) instead of an integer? Example: ./ caesar a Question 2: I found out ...
Christy Ng's user avatar
0 votes
1 answer
94 views

In Pset6, Caesar python implementation, ord() is always returning 99 irrespective of the character.Why is this happening?

Here is my code: import cs50 cipher=[] if len(cs50.sys.argv) != 2: print("You should provide cmd line arguments!") exit(1) k= int(cs50.sys.argv[1]) print("Enter Plain Text:") p=cs50....
Neha Sood's user avatar
0 votes
1 answer
60 views

Caesar doesn't change plaintext?

Program copiles and runs but doesn't change anything to plaintext. #include <cs50.h> #include <stdio.h> #include <ctype.h> #include <string.h> int main (int argc, string ...
Adam Grey's user avatar
0 votes
1 answer
3k views

about caesar,i'm having a segmentation fault

#include<stdio.h> #include<cs50.h> #include<string.h> #include<stdlib.h> #include<ctype.h> int main(int argc,string argv[]) { printf("%s",argv[1]); string k=argv[1]; ...
vedant mahalle's user avatar
0 votes
1 answer
56 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
Zoey 's user avatar
0 votes
1 answer
183 views

Caesar: How text[i] in (text[i] - 97) is getting converted to int?

The text[i] in (text[i] - 97) is getting converted to int when we have assigned string to it. //this part. all the others are int. How text[i] is assigning itself as int here?? if(islower(text[i])) ...
Sooraj.k's user avatar
0 votes
1 answer
738 views

pset2 ATOI function

Hey guys just a quick question on the atoi function. In the Caesar walkthrough video with Zamyla, at around 06:00 she mentions investigating the "atoi" function in order to see what would be returned ...
Pot Noodle's user avatar
0 votes
1 answer
54 views

pset2 Caesar weird error

I uploaded my code in Gist so I avoid doing spoiler to those who have not finish yet. https://gist.github.com/anonymous/3b51071fe9d7226e9bdb43675290956a My code is working mostly fine except some ...
Marco Emmanuel Noto's user avatar
0 votes
1 answer
39 views

Trying to use functions to modify pset2 Caesar characters, get error: expression result unused for each function

So I'm working on pset2's Caesar and wanted decided it would be better to put the algorithm into functions, with each function operating based on whether a character is uppercase or lowercase. Now ...
DeltaFlyer's user avatar
0 votes
1 answer
45 views

Can't figure out how to fix my equation

I've been banging my head trying to figure out why my ciphertext ends up ciphering by a completely different number, and including non-alpha characters. My cipher code is as follows, with ASAL being ...
contranull's user avatar
0 votes
2 answers
604 views

Cannot use atoi function. caesar

I am getting error messages compiling this code though it seems right. What did I do wrong since i'm just following examples. I am following the examples of using the atoi function but am still ...
David's user avatar
  • 11
0 votes
1 answer
412 views

pset6 caesar in python

I'm currently working in rewriting caesar into python, and I'm making good progress but I keep running into an error, after I enter the plaintext, it says Traceback (most recent call last): File "...
Joel Banks's user avatar
0 votes
1 answer
2k views

caesar: expected prompt for input, found none

I got an error: " expected prompt for input, found none" but program works totally fine. What is it about? What did I do wrong? #include <stdio.h> #include <cs50.h> #include <stdlib.h&...
Olenka Slyusar's user avatar
1 vote
2 answers
212 views

Pset2 Caesar is not printing non-alphabetic characters

My Caesar for problem set 2 seems to encrypt my plaintext correctly. My problem is just that it won't print any non-alphabetic characters. For instance, when my plaintext is "hello, world" and the ...
Tenacity's user avatar
  • 157
0 votes
1 answer
43 views

problem with displaying encrypted characters

can someone please have a look at my code(portion where im trying to encrypt the pain text in the for loop) and let me know where im going wrong. my program does not display . here is a portion of my ...
cris's user avatar
  • 1
1 vote
2 answers
3k views

error: unused parameter 'argv'

I am writing this simple code for checking if the user has entered the key or not. If not I want to return 1 and show an error msg. Below is the snapshot of my code which I am using. I am getting the ...
Mohit Sharma's user avatar
0 votes
1 answer
1k views

Pset2 Caesar !! Help?

Please, help me, I can't figure out my problem. This is my code : #include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> int main(int argc, string argv[]...
Kris Le's user avatar
0 votes
1 answer
284 views

Im badly struggling with the logic for caesar pset 2

As title suggests I am really struggling with the logic in doing this...and its really making me think its not for me. But I WILL not give up! The actual coding and telling the computer what to do ...
Jamie Evans's user avatar
0 votes
1 answer
88 views

PSET2 Caesar Bug in Uppercase Case For Loop

having an issue with caesar.c. I've got a loop working for lowercase cases where the key size would cause the key to loop out of alphanumeric characters, but when I try to implement the same loop for ...
mschweitzer1's user avatar
0 votes
1 answer
78 views

pset2 caesar Typecasting error

My program will compile and run, but it prints out exactly what I enter in. I've run it through the debugger and it looks like it can't identify the different cases, so rather than split at the ...
pdhannum's user avatar
0 votes
1 answer
87 views

Question on Caesar Pset2

I am getting an error code :( encrypts "barfoo" as "yxocll" using 23 as key expected "ciphertext: yxo...", not "ciphertext:ycip..." I am trying to add the ciphertext: tp the printf("%c" .....) ...
Yahunatan Zackarny's user avatar
-1 votes
1 answer
117 views

caesar.py else syntax

In my caesar.py program, I seem to have a syntax error with one of my else statements, however I triple checked the indentation, made sure to include a colon afterwards, it is inline with the if ...
Achmed's user avatar
  • 3
0 votes
2 answers
2k views

CS50 week 2 Caesar(cipher printf question)

#include <stdio.h> #include <stdlib.h> #include <cs50.h> #include <ctype.h> #include <string.h> int main( int argc,string argv[]){ int k; if (argc == 2) { ...
Der Traumwanderer's user avatar
0 votes
1 answer
125 views

Caesar Pset2 wont pass the check50 though the output is correct?

im totally a newbie in coding and if u guys just help me out i worked hard with the code and i just want it to pass the check50 i check the output on command line and there is no problem !! i wonder ...
Homan's user avatar
  • 3
0 votes
1 answer
253 views

Problem with caesar cipher encryption

I'm trying to solve pset2 Cesar encryption.Everything seems fine and encryption is working but when I hit check50 I get errors: :( encrypts "a" as "b" using 1 as key expected prompt for input, ...
Xample's user avatar
  • 1
1 vote
1 answer
395 views

pset2 Caesar - How to properly implement modulus operator

I understand the necessity of using the modulus operator to compensate for plaintext characters that would surpass Z or z respectively, but I cannot seem to wrap my head around its particular syntax. ...
AvidUrner's user avatar
1 vote
2 answers
89 views

Pset2 Caesar struggle but i gotta do it im from Rome

Ave thanks in advance for your help total newbie trying to make pset2 caesar. here is the error caesar.c:14:1: error: expected identifier or '(' {{ ^ 1 error generated. here is the code #include ...
idbeentaken's user avatar
0 votes
1 answer
160 views

Caesar,Pset2,check50

in Ceasar, whenever I run check50, I get this error: :( encrypts "a" as "b" using 1 as key \ expected output, but not "plainText:" :( encrypts "barfoo" as "yxocll" using 23 as key \ expected ...
Raw's user avatar
  • 9
1 vote
2 answers
379 views

Pset2 - Caesar (less comfortable) wraparound problems

if (isalpha(plain[i])) if (isupper(plain[i])) { printf("%c", ((plain[i]-65) + k) % 26); } if (islower(plain[i])) { printf("%c", ((plain[...
MK3107's user avatar
  • 33
0 votes
1 answer
67 views

How do I store the values into the string cipher rather than printing it out directly?

I know I can use printf to directly print it out, however, if I wanted to store it into the string cipher and then print that out is it possible? int main(int argc, string argv[]) { if (argc != 2)...
Ryan A's user avatar
  • 3
0 votes
2 answers
3k views

pset2 caesar converting from ascii to alphabetical

#include <stdio.h> #include <cs50.h> #include <stdlib.h> #include <string.h> #include <ctype.h> int main(int argc, string argv[]) { if (argc == 2) { int ...
Knovolt's user avatar
1 vote
2 answers
324 views

pset2, Caesar. Can't pass testing [duplicate]

I have a problem with check my code CS50, my code is below: #include <cs50.h> #include <stdio.h> #include <string.h> //desribe of values //int i - number of arguments //int n - ...
Alexander Lyapunov's user avatar
0 votes
1 answer
112 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 ...
Alexander Lyapunov's user avatar
0 votes
1 answer
59 views

Output from a char shift greater than 26

I can't wrap my mind around why some letters get properly shifted and others don't, when I have a k of greater than 26. For example, one of the checks is p=barfoo, k=65 and I get ÏÎeÓbb instead of ...
Tod Lazarov's user avatar
0 votes
1 answer
137 views

Pset2 Caesar won't compile

My code won't compile and I can't tell why. All of the error messages I'm receiving are regarding my "for" statement and my use of the variable i. I also get an error message about my use of "string" ...
Allie Pozerycki's user avatar
0 votes
1 answer
70 views

New question on Caesar

I have moved on from my previous Caesar question however am now getting a few errors as follows: caesar.c:33:26: error: use of undeclared identifier 'i' if islower(plaintext[i]) ...
antonio.caminiti's user avatar
0 votes
1 answer
407 views

PSet 2 Getting Segmentation Fault Error for Caesar

I am getting a segmentation fault error for my code for Caesar, but I do not know what this means or know how to fix it. #include <stdio.h> #include <cs50.h> #include <string.h> #...
Alex Durante's user avatar
0 votes
1 answer
706 views

2017 pset2 caesar - what am I missing here?

Might be something silly but it seems that my code is working fine but check50 is not so happy with it, any pointers? Here is my code: Here is the check50 result (which seems to be correct but still ...
Afrikaans Hipster's user avatar
0 votes
2 answers
178 views

Basic questions on Caesar problem

I have some basic questions on the Caesar problems which I would appreciate assistance on. Apologies in advance if the questions seem quite basis but I am putting a lot of hours into this and am ...
antonio.caminiti's user avatar
0 votes
1 answer
539 views

pset2 caesar.c (need help,Thank)

check50 :( encrypts "world, say hello!" as "iadxp, emk tqxxa!" using 12 as key \ expected output, but not "ciphertext: iadxpemktqxxa\n" #include <cs50.h> #include <stdio.h> #include &...
RedRabbit's user avatar
0 votes
1 answer
67 views

Caesar final result

Please help me, i have expected expression error for else if and else, but I don't understand why. Thank you. here is my code :#include <cs50.h> #include <stdio.h> #include <stdlib.h&...
Genevie's user avatar
  • 30
0 votes
1 answer
203 views

Caesar final print

My result is wrong ! when I enter a word in plaintext, it just print 2 letters for infinity. Please help me understand how I can print ciphertext and the answer correctly please. Here is my code : #...
Genevie's user avatar
  • 30
0 votes
1 answer
116 views

Road block again!!! Caesar pset2

What does this mean?: ":( handles lack of argv1" My code passed all the checks except for this one.
bullseye189's user avatar
0 votes
1 answer
220 views

Pset2 Caesar variable problem

I can't figure out whats wrong. Here's my code: //argc and argv allow to for users to input data before the program runs. int main (int argc, string argv[]) { //Do-while loop to ensure user ...
Jrazi's user avatar
  • 1
0 votes
2 answers
276 views

pset2 Caesar argc, argv, and string not being recognised when i 'make' the program

It seems like such a simple problem but its happened to me in previous psets and i cant seem to figure it out. I've run update50 and I've included all the header libraries--I have no clue why the ...
Jrazi's user avatar
  • 1

1
3 4
5
6 7
9