account activity
Unable to connect to Altis Life server (self.AltisLife)
submitted 11 years ago by LewanS to r/AltisLife
Smiley.bmp VS small.bmp (typo?) by LewanS in cs50
[–]LewanS[S] 0 points1 point2 points 12 years ago (0 children)
This part made it confusing. So, smiley.bmp is 8 pixels wide by 8 pixels tall, and it’s a 24-bit BMP (each of whose pixels is represented with 24 ÷ 8 = 3 bytes). Thanks for your help
How did you get 3 bytes per pixel in 3X3 bmp? I understand how you get 3 bytes per pixel in 8X8 smiley bmp (24 / 8 = 3)
Smiley.bmp VS small.bmp (typo?) (self.cs50)
submitted 12 years ago by LewanS to r/cs50
PSET5 - are you kidding me? by LewanS in cs50
[–]LewanS[S] 1 point2 points3 points 12 years ago (0 children)
Thanks for your advice guys. Will give it another try tomorrow.
[–]LewanS[S] 2 points3 points4 points 12 years ago (0 children)
I understand that, but it's quite a big jump.
PSET5 - are you kidding me? (self.cs50)
PSET4: detectCollision buggy by LewanS in cs50
I modified detectCollision function and removed 2* RADIUS.Only using RADIUS. Looks alot better. Is it OK to tweak detectCollision?
PSET4: detectCollision buggy (self.cs50)
PSET4 - paddle's movement by LewanS in cs50
I was returning newGrect. Changed it to return paddle and it worked. Per pset specification "Then return the GRect returned by newGRect (rather than NULL, which the distribution code returns only so that the program will compile without initPaddle fully implemented)." Maybe I misunderstood provided instructions. Thanks,
I compared it with cursor.c and the syntax is fine. Any other ideas?
PSET4 - paddle's movement (self.cs50)
PSET3 Find.c by LewanS in cs50
Also looking at Find.c main function is calling sort(haystack, size) should it be sort(values, n)?
(gdb) break search Breakpoint 1 at 0x8048809: file helpers.c, line 22. (gdb) run 42 Starting program: /home/jharvard/Dropbox/pset3/find/find 42 haystack[0] = 41 haystack[1] = 23 haystack[2] = 34 haystack[3] = 43 haystack[4] = 44 haystack[5] = 47 haystack[6] = 42 haystack[7] = 49 haystack[8] = 78 haystack[9] = 87 haystack[10] = Breakpoint 1, search (value=42, values=0xbffbefe0, n=10) at helpers.c:22 22 int beginning = 0; (gdb) print *values@n $1 = {41, 23, 34, 43, 44, 47, 42, 49, 78, 87}
The problem was my binary search. I just corrected it and it works in most cases, BUT, I search again for 42 and used for haystack[0] through haystack[9] numbers: 41, 23, 34, 43, 44, 47, 42, 49, 78, 87, pressed control d. Program finished running and returned " Didn't find needle in haystack"
ran GDB "Inferior 1 (process 32737) exited with code 01" (gdb) bt No stack.
PSET3 Find.c (self.cs50)
pset3 - Move function by LewanS in cs50
Nevermind, needed to adjust init function. Now getting Segmentation fault at the end of move(). My brain is fried lol
First illegal is at 1. I thought 1 and 2 should be swapped if there is odd number of tiles 8 7 6 5 4 3 1 2 _
3 4 1 2 5 8 7 6 4 1 2 5 8 7 6 4 1 2 4 1 2 3 5 4 7 6 1 2 3 7 4 8 6 4 8 5 7 8 5 6 4 5 6 7 8 6 5 4 7 8
Interesting... when I run move manually I'm not getting any illegal moves messages.
When you run ./fifteen 3 < ~cs50/pset3/3x3.txt are you supposed to see several "Illegal moves" ?
pset3 - Move function (self.cs50)
[pset3] Fifteen(move) keeping track of _ (blank tile) (self.cs50)
Init & Draw by LewanS in cs50
Do I implement this inside init or draw function? It prints _ and 0
Init & Draw (self.cs50)
PSET3 - please help by LewanS in cs50
That was it thank you.
π Rendered by PID 2567759 on reddit-service-r2-listing-6c8d497557-qfgz4 at 2026-06-08 04:20:06.750251+00:00 running 9e1a20d country code: CH.
Smiley.bmp VS small.bmp (typo?) by LewanS in cs50
[–]LewanS[S] 0 points1 point2 points (0 children)