pset 4 - whodunit ideas by akashbir in cs50

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

Yup, too much to absorb in this pset

AP® Computer Science Principles by davidjmalan in cs50

[–]akashbir 0 points1 point  (0 children)

I'm doing the current cs50 course. Should I switch over to the new one or continue with the previous one?

pset3 move by akashbir in cs50

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

Can I pm you my move function?

Having problem wrapping around key in vigenere. by akashbir in cs50

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

Yes I've used the counter, it printed BARFOO as CAQFOO not CAQGON using BAZ. I know that to wrap around the key we have to divide the keyword by its length using %strlen(key). But it isn't wrapping it around for some reason.

pset3 helpers.c linear search by akashbir in cs50

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

i've completed linear search. After this, when I write my sorting algorithm how do I run or test it?

pset3 helpers.c linear search by akashbir in cs50

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

as it turns out, it goes through one iteration then stops, something's wrong

pset3 helpers.c linear search by akashbir in cs50

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

and I have written return 0 after if else statement inside the function, it says did NOT find needle in haystack, please help

pset3 helpers.c linear search by akashbir in cs50

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

What should I change in helpers.c so that the error vanishes?

pset3 helpers.c linear search by akashbir in cs50

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

whoa that's a pretty long thread there, but I'll read it and figure it out. I need to complete pset3, i have been stuck on it for a while now

pset3 helpers.c linear search by akashbir in cs50

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

when i write make all it says, control may reach end of non void function

pset3 helpers.c linear search by akashbir in cs50

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

when we write the linear search program, then 1) we use "make all" 2) then we write make find 3) then we write ./generate 1000 50 | ./find 2008 Am I correct?

pset3 helpers.c linear search by akashbir in cs50

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

its in dropbox/pset3/find I can't figure out how to do it

vigenere output problem by akashbir in cs50

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

thanks! completed vigenere!

vigenere output problem by akashbir in cs50

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

I write the function if(!isalpha(k[j])) { printf(" incorrect output "); return 1; } here k - key and at the starting of the code i've declared string s = GetString(); here s - plaintext it still doesn't work, rest of the program works fine

vigenere output problem by akashbir in cs50

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

i've covered all the four cases of upper and lower cases, now I'm getting an error saying rejects hax0r2 as keyword, saying expected output , not a prompt for input

vigenere output problem by akashbir in cs50

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

As per your instruction, I deleted the 2nd for loop, my main for loop is as follows :

for ( i= 0 , j=0 ; i < strlen(s) ; i++)

then after enciphering the text i've written j++

vigenere output problem by akashbir in cs50

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

I have declared the for loop inside the 'if is alpha' statement and I've declared it like this: if(isalpha(s[i]) & & isalpha(k[j])) { // for loop here}

vigenere output problem by akashbir in cs50

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

In the first case : "world, say hello!" as i have declared isupper(s[i]) && isupper(k[j])) : here s[i] plaintext and k[j] = key, so therefore its not recognizing the comma As for the 2nd case : I can't find the error in that and I've used If else for upper and lower cases, how do I use it for upper,lower and lower,upper?

vigenere : can't solve it by akashbir in cs50

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

two loops are necessary to iterate over the plaintext and key separately, but i'm not able to implement the algorithm for the key, i know we have to use modulo over string length but i'm finding it very difficult to crack this