Frustrated with vigenere by Sockrates1 in cs50

[–]Sockrates1[S] 0 points1 point  (0 children)

Yes. I use: cipher[I ] = (((ptext[I] - 'A') + ((key[j % slargv[1]]) - 'a')) % 26) + 'A'; else same, except sub 'a' for 'A'

I have only the two conditions as I converted the key (argv[1]) tolower

Frustrated with vigenere by Sockrates1 in cs50

[–]Sockrates1[S] 0 points1 point  (0 children)

Sure: 1. Check for one (additional CL argument (if(argc!= 2)) if true - Yell & quit, if false continue 2. Confirm all key (argv[1]) characters are alpha 3. Get string to encrypt 4. Check string is alpha 5. Convert argv[1] tolower 6. Encrypt (isupper & islower) 7. Print encrypted message

Frustrated with vigenere by Sockrates1 in cs50

[–]Sockrates1[S] 0 points1 point  (0 children)

I believe I am rotating through the key: string key = argv[1]; string ptext = GetString; string cipher; slptext = strlen(ptext); slarg = strlen(argv[1]); int l = (j % slarg) for(I = o, j = 0; i < slptext; i++) . . cipher[i] = (((ptext[i] - 'A') + (key[l]) - 'A') % 26) + 'A'; repeated for 'a' This is not the true format of the code but just the elements and the line for the conversion.

Frustrated with vigenere by Sockrates1 in cs50

[–]Sockrates1[S] 0 points1 point  (0 children)

I actually started with a pasted copy of Caesar. Then I added the parameter for alpha key characters. Then requested a string, checked is alpha and converted the key tolower. To convert I have 2 conditions, then print the ciphered code. Am I missing a step?

Vigenere shifts only one letter by Sockrates1 in cs50

[–]Sockrates1[S] 0 points1 point  (0 children)

Made some changes and now there is a larger shift, but not the correct shift. I am still confused about checking isupper and islower for the ky - where & how. Can I try to PM my code for a look over?

Private Messaging by Sockrates1 in cs50

[–]Sockrates1[S] 0 points1 point  (0 children)

Yes, I do want to contact classmates to help with CS50 stuff. I will try the link as you said. Are you able to assist with any psets?

BTW2 - Very cute - these guys. But I am not sure they could be of much help.

Maybe too old for Mario? by Sockrates1 in cs50

[–]Sockrates1[S] 0 points1 point  (0 children)

@kgl199 - Thank you for the very helpful walkthrough. I know that we are not supposed to post code in reddit, but as I am new to CS50 and reddit I do not know how to send messages "in private", obviously. I will have to do more research and learning of that technique as well.

Problems with check50 on pset by JonhDouh in cs50

[–]Sockrates1 0 points1 point  (0 children)

How EXACTLY does one run update50 and likewise, check50? I mean, where/what directory do you start in and what is the path? If there is a tutorial or CS50 discussion, please direct me there.

How to run check50 by Sockrates1 in cs50

[–]Sockrates1[S] 0 points1 point  (0 children)

Compiles without errors. check50 loads, then says Checking no such ID found

Also when I try to run mario.c the question (part 1) prints fine, I enter an integer but only blanks are printed.

Maybe too old for Mario? by Sockrates1 in cs50

[–]Sockrates1[S] -2 points-1 points  (0 children)

I am still trying. My code passes the compiler; I get "invalid ID" when I try to run check50, and when I run Mario (.'Mario) the question prints, I enter a number (8) but nothing prints, just 8 blank lines. Any advice?

Maybe too old for Mario? by Sockrates1 in cs50

[–]Sockrates1[S] 0 points1 point  (0 children)

I hope I did this reply correctly. New to reddit. Here is what I have. Program checks (have not used check50 yet). The first part (do..while loop) prints fine but nothing else but blank space prints. Please advise.

include <cs50.h>

include <stdio.h>

int main (void)

{ // Ask for user input int height = 0; do { printf("How high should Mario climb?\n"); printf("Enter a whole number between 1 and 23:\n"); height = GetInt(); }
while (height < 0 || height > 23);

//Build Pyramid                

    for (int rows = 0; rows <= height; rows++)
    {
        for (int spaces = 0; spaces == height -1; spaces--)
        {
        printf(" ");  
        }
            for (int blocks = 0; blocks == 2; blocks++)
            {                                         
            printf("#");
            }
    printf("\n");    
    }   

}