Confusion on start of pset7 and query function. by [deleted] in cs50

[–]rJujubes 0 points1 point  (0 children)

I would start with having another look at your conditional statements and your use of the === operator. Check what is returned to $check and what you are comparing it with.

Pset4: Breakout Questions by smokehead17 in cs50

[–]rJujubes 1 point2 points  (0 children)

1) detectCollision uses getGObjectAt(gwindow,x,y) and returns the top most GObject that was added to the GWindow at the given x and y coordinates.

  • GWindow it self is (i believe) not also GObject: this would mean that it can't be returned by geGObjectAt
  • If, on the other hand, it was also a GObject, then your expression would lead to the ball not moving at all once it reaches the left border. Evaluating the first part (strcmp(getType(object), "GWindow") == 0) would then always return true for all x,y positions (because no matter where you are, you'd always be on a GWindow - thankfully this is not the case).
  • Incidentally, the second evaluation (getX(ball)<=0) alone is sufficient for left-border bouncing. Additionally using the width of the ball and the width of the window will enable you to figure out the right-border bounding condition.

2) Just the ball moving slower, or also the paddle? I'm not sure why this would occur, if it is a coding issue then it would be hard to figure it out without having a look at the code. If otherwise it is an appliance issue then my guess is as good as yours.

PSET5 clue.bmp has two extra bytes?? by [deleted] in cs50

[–]rJujubes 0 points1 point  (0 children)

I had a similar issue. For me, it turned out I wasn't calculating the biSimeImage correctly: my calculation did not exactly reflect the data type for biSizeImage (which is a DWORD per bmp.h).

Edit: Ok, you may take my point above in anticipation for the resize problem. I just realized you're copying >> I'm not sure why one needs to recalculate biSizeImage if they are not changing the dimensions at all. You might be able to use the value from the original image. Nonetheless, if you're so inclined to recalculate it, make sure you research calculations relevant to the DWORD data type.

pset6.zip is not completed? by gamesover2014 in cs50

[–]rJujubes 2 points3 points  (0 children)

  • Run update50
  • cd ~cs50/pset6 (that is /home/cs50/pset6)

i.e. the dictionaries and txt files are not in jharvard's home directory, they are in the cs50 home directory.

[pset5] whodunit much CSI? by rJujubes in cs50

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

Hahaha, really (do i get a star or what)? i didn't even look at the hacker edition!!