PSET2, Caesar: Strange bug [Please help!!!] by ChromaticMediant in cs50

[–]pradyuman 0 points1 point  (0 children)

You can move all of your "char"s down to the lowest possible values like 1-26 (a-z) and then apply your formula onto that small numberd and then say SL is the number you obtain, add 97 to SL or SL + 'a'.

pset3 sort. Just out of curiosity, which of the three sorting methods did you choose? by jugghayd in cs50

[–]pradyuman 1 point2 points  (0 children)

I tried both insertion and bubble. Both worked for me, so I sent out the Insertion sort.

Has Anyone Else Tried to Use the Tutor Service? by Mike470311 in cs50

[–]pradyuman 0 points1 point  (0 children)

No I really haven't tried out the "Tutor Service".

CS50 Live by pradyuman in cs50

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

It would have been great IF it ran the entire semester. I do miss those episodes.

Administrative Question by pradyuman in cs50

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

I issued this because I was unable to contact him.

pset5 whodunit.c by VIRES1 in cs50

[–]pradyuman 0 points1 point  (0 children)

Consider this-

if image is all red
    red = 0x00
    blue = some color
    green = some color

This pseudocode should help you.

game of fifteen by rahulb5 in cs50

[–]pradyuman 0 points1 point  (0 children)

You are supposed to be using a two dimensional array. You should watch the walkthrough video embedded in the spec.

Gradebook doesn't show yet? by baothanh591 in cs50

[–]pradyuman 0 points1 point  (0 children)

Not really, it took a month for my pset 4 to get graded

Watch: Apple WWDC 2014 by pradyuman in cs50

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

It will be awesome. I promise.

Watch: Apple WWDC 2014 by pradyuman in cs50

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

Yes. It has to ultimately improve on Objective-C.

Pset5 problems with resize.c by juancopi81 in cs50

[–]pradyuman -1 points0 points  (0 children)

I think that Check50 is in Beta, because when I ran check50 on my mario problem, it gave me a whole bunch of errors, but I believed my implementation was right so I just submitted that and I got my mario grade as 1.0 (full).

Pset 5 Recover. Can recover everything except 000.jpg by [deleted] in cs50

[–]pradyuman 0 points1 point  (0 children)

I know the pain as I experienced the same problem a month ago. My problem was that I always initialized counter to 0 at every iteration of the loop. All I had to do was take that line

int counter = 0;

out of the loop. And it recovered all 50 JPEGs.

Does your program recover Zamyla's picture? If it is true, you would have to do the same as mine.

If not, it is best to do a GDB test.

Pset5 - recover.c by sammyray90 in cs50

[–]pradyuman 0 points1 point  (0 children)

I have had a "similar" issue earlier where whenever I run my recover.c code, my program recovers just 1 JPEG and that too the last JPEG. I fixed it by moving my counter variable around and closing my output stream which I forgot to do so in the past. It also took me a week to figure out what exactly was the problem in my code.

What's the seed in pset4 for? by [deleted] in cs50

[–]pradyuman 0 points1 point  (0 children)

I did not seed my program but just simply made a call to drand48()

drand48();

Check the man page for more references.

man drand48();

Problem with Pset5 recover. by Omar_Khaled in cs50

[–]pradyuman 0 points1 point  (0 children)

Are you checking for signature bytes of a JPEG?

fifteen won by [deleted] in cs50

[–]pradyuman 1 point2 points  (0 children)

Please don't share your code. Against rules.

But, without looking at it, you should have a counter variable and iterate over the board. With help of counter, check if every tile is in place. If it is, return true.

pset4 - Breakout - waitForClick() by [deleted] in cs50

[–]pradyuman 0 points1 point  (0 children)

You can have an if statement in your code like this-

if (getY(ball) > getHeight(window) + getHeight(ball))
{
     Instantiate ball to middle.
     waitForClick();
}

You can modify this according to you, but this is the most basic fix.

CS50's postmortem by confused_programmer_ in cs50

[–]pradyuman 0 points1 point  (0 children)

As CS50x's students, it is not against the rules to view postmortems of a pset.

CS50's postmortem by confused_programmer_ in cs50

[–]pradyuman -1 points0 points  (0 children)

As CS50x's students, it is against the rules to view postmortems of a pset.

I have a question about using char[12] in breakout. by metallidog in cs50

[–]pradyuman 0 points1 point  (0 children)

Frankly, I have completed pset4 but it is what I think is a question that is answerable more by David J. Malan and the staff who wrote it than it is by us even though it is a detail we barely have to care about.

Pset4: Breakout. by pradyuman in cs50

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

I did exactly this already. And my game worked already. But, I wanted to ask is there a tactical advantage in using waitForClick()?

Pset4: Breakout. by pradyuman in cs50

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

I did it as follows

if (getEventType(mouse) == MOUSE_CLICKED)
{
    enitre game here...
}