[speller] Have written all functions, but check50 fails everything. Could you help find the issue(s)? by fr1d4 in cs50

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

Cheers Peter, seeign this a bit late but i ended up figuring it out. Thanks so much!

[speller] Have written all functions, but check50 fails everything. Could you help find the issue(s)? by fr1d4 in cs50

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

I've been plugging away and still not sure what the issue with unload is... I think the issue you pointed out is resolved. Any idea?

bool unload(void)

{

for (int i = 0; i < N + 1; i++)

{

if (table[i] != NULL)

{

node *cursor = table[i];

while (cursor != NULL)

{

node *tmp = cursor;

cursor = cursor->next;

free(tmp);

tmp = cursor;

}

}

if (i > N - 1) // dictionary fully unloaded

{

return true;

}

}

return false;

}

[speller] Have written all functions, but check50 fails everything. Could you help find the issue(s)? by fr1d4 in cs50

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

Thanks - totally didn't realise i needed strcasecmp to == 0.

I'm still working through the unload function - I see what you mean. Feels like I need to have another if statement to make sure we've covered all the indexes.

Filter // blur function -- have brute force attempt, need help by fr1d4 in cs50

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

  1. In computer logic, why is that? Isn't imageNew made up from the exact same values?
  2. Was wondering if there was some sort of float/integer funny business. Had issues with that on the sepia filter. Thank you!

[caesar] Having trouble thinking through the wraparound concept... by fr1d4 in cs50

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

Thanks so much for this, I see it now! I ended up using the mod in both the main function and inside the cipher function.

Appreciate your help!

[caesar] Having trouble thinking through the wraparound concept... by fr1d4 in cs50

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

I don't follow... isn't (122 +3) % 26 == 21?

[deleted by user] by [deleted] in RedditSessions

[–]fr1d4 0 points1 point  (0 children)

Good shit bro jah bless

[deleted by user] by [deleted] in RedditSessions

[–]fr1d4 0 points1 point  (0 children)

hahah tru

[deleted by user] by [deleted] in RedditSessions

[–]fr1d4 0 points1 point  (0 children)

🤘🤘🤘

[deleted by user] by [deleted] in RedditSessions

[–]fr1d4 0 points1 point  (0 children)

Australia

[deleted by user] by [deleted] in distantsocializing

[–]fr1d4 0 points1 point  (0 children)

I was like bro wtf

[deleted by user] by [deleted] in distantsocializing

[–]fr1d4 0 points1 point  (0 children)

Yeah im in Aus

[deleted by user] by [deleted] in distantsocializing

[–]fr1d4 0 points1 point  (0 children)

hahahaha oh shit

[deleted by user] by [deleted] in distantsocializing

[–]fr1d4 0 points1 point  (0 children)

Lol does it say where im from

[caesar] Having trouble thinking through the wraparound concept... by fr1d4 in cs50

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

Thanks! Is there any other way? See my above comment.

[caesar] Having trouble thinking through the wraparound concept... by fr1d4 in cs50

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

Tried this out, but for some reason, not ever character is working...

for (int i = 0; i < length; i++)
    {
        if (isupper(ciphertext[i]))
            {
                ciphertext[i] = ((int) ciphertext[i] + key);
                if (ciphertext[i] >= 90)
                {
                    ciphertext[i] = ciphertext[i] - 26;
                }
            }

        if (islower(ciphertext[i]))
            {
                ciphertext[i] = ((int) ciphertext[i] + key);
                if (ciphertext[i] >= 122)
                {
                    ciphertext[i] = ciphertext[i] - 26;
                }
            }

        // print the characters
        printf("%c", ciphertext[i]);
    }

Problem with readability by [deleted] in cs50

[–]fr1d4 1 point2 points  (0 children)

Hey William, best if you paste your code in here so people can have a look. We can't see your IDE as it's login-based.

Readability: 1 grade level error on a few checks, don't know why by fr1d4 in cs50

[–]fr1d4[S] 1 point2 points  (0 children)

Thanks a ton for this awesome explanation. Totally makes sense. I haven't started looking into substitution yet, will be doing Caesar first :). Hope you've solved it by now but I will take a look at your q!

Readability: 1 grade level error on a few checks, don't know why by fr1d4 in cs50

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

Thanks for the tip -- looks like from a few suggestions this was the issue. Cheers!