Questions tagged [pset3]

The problem set for Week 3 asks students to write code for a classic puzzle game in the C programming language.

Filter by
Sorted by
Tagged with
0
votes
1answer
25 views

PSET 3 recover I can't open pointers. Always returns a NULL value

Whenever I try to run this code, it returns "could not open file", which means that jptr is assigned a null value. I don't know how to get rid of this, tried so many solutions. It keeps on happening ...
0
votes
1answer
50 views

writing pixels n times to array

i'm struggling trying to figure out how to store pixels n times to an array for (int i = 0, biHeight = abs(oldheight); i < biHeight; i++) { // iterate over pixels in scanline for (...
0
votes
1answer
26 views

pset3 resize (less) resize vertically

I've been working on resizing vertically, but the output always display wrong color as below (n=2): The code worked fine up until the end of horizontal resizing, producing a horizontally stretched ...
0
votes
1answer
40 views

bfSize error in check50 PSET3 Resize (less)

The code does what it's suppose to do visually. It resizes the image but it appears that there is an error with the bfSize. I have no idea where the mistake is and have tried everything I can think ...
0
votes
1answer
22 views

pset3 resize less output messed up

I'm working on the resize (less version) problem, but the output image is a messed up block of color boxes. Is there something wrong while I'm iterating over the lines? Thanks! #include <stdio.h&...
0
votes
1answer
77 views

How does RGBTRIPLE differentiate between the 3 bytes it reads from input file and assign them to rgbt blue, green and red?

sorry if the question is confusing, but i completed the whodunit problem in pset3 and my doubt was that in the following code: // iterate over pixels in scanline for (int j = 0; j < bi....
0
votes
1answer
33 views

PSET 3: Color is messed up

I can't figure out how to fix the colors of large.bmp when I run it. It resizes correctly but the pixels are all messed up and don't look like the original. Someone help me? Please and thank you! // ...
0
votes
1answer
55 views

Why is my cs50 resize not working?

I have been working on cs50 resize less for 3 weeks on and off and can't seem to get the image to be resized properly. The real problem is I don't know where my program is failing. Can anyone point ...
0
votes
1answer
193 views

Recover cs50 Please help!

Can somebody please help with this question? ... and also I tried to debug and apparently it doesn't run my while loop and i don't understand why. while (fread(buffer, 512, 1, fraw) == 1) so ...
0
votes
1answer
33 views

CS50 Resize(less comfortable) I can't create OUTFILE

I've been working on this pset for quite a few days now, but my program doesn't seem to be compiling. It keeps saying "could not create outfile"(my message). I have no idea what to do. Any help would ...
0
votes
1answer
1k views

Pset3: Tideman - sort_pairs error!

I have difficulty to understand what should the output of the function sort_pairs() should be!, What I understand is I should take the unsorted pairs[] and sort it. For example, this is pairs[] ...
0
votes
1answer
34 views

I need a little help with resize less comfortable (Please!) - There's a bug in my program

Okay hi! So everything looks good, it's able to resize horizontally & vertically. For instance, when i set n as 4, the 3x3 pixel will be enlarged to However, when i set n to (2 or 3), the ...
0
votes
1answer
28 views

Pset 3 Resize (less) Wrong Colors

I have looked at a variety of other questions about getting the wrong colors, so I know that I have some sort of padding issue, but I have no idea what exactly it is/how to fix it. I get the correct ...
2
votes
1answer
5k views

Pset3: Plurality - Weird output!

This program is for counting the plurality for a list of candidates, Check Description for more info, The program works like this: Enter the candidate's name as an argument when running the program ...
1
vote
0answers
23 views

What's wrong with saving the scanline array elements in my code for resize (less), Pset3 problem?

I've solved the problem by recopy method successfully and thanks to many helpful answers to others' questions. Now I'm trying to solve be rewrite method and I think I have a problem with storing ...
0
votes
1answer
73 views

CS50 Recover.c | No idea what and where i'm going wrong | Can't debug or compile in CS50 IDE

I'm trying to debug in CS50 IDE but I'm continuously receiving this error; debug50: recover: No such file. and if I try to compile it says this "make: *** No rule to make target 'recover'. Stop." ...
0
votes
1answer
37 views

I'm stuck on Resize (Less). Please help!

I can't seem to figure out what's wrong with my resize code - it only resizes correctly for n = 1. I've checked the header data when n = 4 compared to large.bmp, and it's the same. If anyone knows ...
1
vote
1answer
127 views

What's wrong with my Resize (Less) code? Pset3

I've been stuck with Resize (Less) using the "Rewrite" method for days but just can't seem to figure out what's wrong with my code. My code compiled OK, and has no problem with n=1. But it can't ...
0
votes
1answer
66 views

pset3 “Recover”

I am facing some troubles, only one blank image is generated , any help? // Program to recover lost photos. #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <...
0
votes
1answer
38 views

PSet 3: resize (less) bfsize error

I'm SO close (I think!) to being done with "Resize (Less)" after a grueling run. After running check50, I'm a bit kerfuffled. Hexadecimal form of output file seems correct, as do the values of and ...
0
votes
0answers
17 views

debugger only check the first breakpoint then jump to the end of code

I have tried many times , the debugger can only check the first if statement and it can be step over in the first if statement. But When it finished the if statement, just jump to the end of code, ...
0
votes
1answer
34 views

resize.c write to array

I think i made a breakthrough in this one with the rewrite method but i need to know how to write the triple to the array i tried a couple of things but didn't work out here's my code : int main(int ...
0
votes
1answer
82 views

PSet 3: Help with colors for “whodunit”

I've successfully decoded the solution to "Whodunit" from CS50 2018 (won't put the spoiler here, though will say the culprit's name has six letters), but will admit it was a lucky guess involving ...
0
votes
0answers
14 views

Is there supposed to be a RGBQUAD header in smiley.bmp of Pset3's resize since it's a 24-bit BMP file?

I read the background section and it said there's an additional header right after BITMAPINFOHEADER called RGBQUAD for 24- or 32-bit BMPs, but smiley.bmp doesn't have that RGBQUAD header. Is it ...
0
votes
1answer
103 views

Recover produces 49 blank images

I know that there are many other issues with my code, but I cannot seem to understand why only 49 images are recovered. Also, it would be great to get any pointers to why all of the recovered are ...
0
votes
1answer
44 views

resize less help needed

i'm feeling so close to solve it but have some issues with the for loops i tried to debug it and see what's going on but yet there's some things i can't explain specifically with triple variable i'm ...
0
votes
1answer
34 views

PSet 3 resize (less)

I'm just trying the "resize horizontally" step for now, but I'm dreadfully confused and can't get it to work. Could someone take a look at my code and nudge me in the right direction? Thank you: /...
0
votes
1answer
29 views

Confusion with understanding how new values are assigned

I do not quite understand how this reuse of variables is incorrect: // save initial values int initial_Height = bi.biHeight; int initial_Width = bi.biWidth; int initial_padding = (4 - (...
1
vote
1answer
43 views

resize less help needed please

I've been watching the walkthrough for 3 days now and can't understand the whole idea, i read the spec and wrote couple lines of code finally i decided to write the code with only psuedocode in the ...
0
votes
1answer
58 views

Recover help - only 2 imgs are getting recovered

#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { if(argc != 2) { fprintf(stderr, "Usage: ./recover <filename>\n"); return 1; } ...
0
votes
1answer
80 views

Error on running recover

#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { if(argc != 2) { fprintf(stderr, "Usage: ./recover <filename>\n"); return 1; } ...
1
vote
1answer
236 views

how to answer whodunit questions

i don't know how to answer those questions there's no clue how to solve them i checked all the links doesn't include most of them, though i finished the pset. Any help would be very appreciated.
0
votes
1answer
21 views

Need help on vertical resize

// Copies a BMP file #include <stdio.h> #include <stdlib.h> #include "bmp.h" int main(int argc, char *argv[]) { int n = atoi(argv[1]); // ensure proper usage if (argc != 4 ||...
0
votes
1answer
158 views

Not Recovering the last “Recover” image

Having an incredibly tough time figuring out where my error is. The JPEG outputs look good but when I do check 50, I'm getting a :( for "recovers 049.jpg correctly - recovered image does not match....
0
votes
1answer
137 views

CS50 pset3 recover

After running it, I got the error massage "double free or corruption (top) Aborted". And I only got 000.jpg. Need some advice, thanks. int main(int argc, char *argv[]) { //ensure proper usage ...
0
votes
1answer
85 views

PSET3 resize vertically help

I'm struggled for 12 hours on resize problem. After trying for so long i reach to this result. The smiley BMP file looks well but it doesn't seem to be fully resized. When i try to resize small.bmp ...
0
votes
1answer
47 views

PSET3 Recover generates 50 files, but they are only 0-50% complete. Review appreciated

#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { // ensure proper usage if (argc != 2) { ...
0
votes
1answer
70 views

PSET3 Resize (more comfortable) do not understand why code is not working

I posted my code a few weeks ago, and I have been working on it for a some hours today but I am really stuck as to why it is not working. I have not yet written the code for resizing down. It would be ...
0
votes
1answer
39 views

Pset3 Resize - image has more bytes than expected

I have a problem with this pset3-resize-less. Everything works fine but when I run check50, only first three things are correct: :) resize.c and bmp.h exist. :) resize.c compiles. :) doesn't resize ...
0
votes
1answer
96 views

Stuck on recover for 1 month - a couple of issues

So anyways, ive been stuck on recover for like a month because of some issues, im completely lost and id appreciate some feedback on my program. here are the issues: 1. the program only finds 4 jpegs ...
0
votes
1answer
25 views

In CS50 pset3 resize (less), the bfSize and biSizeImage are different than the correct values. Why?

outbf = bf; outbi = bi; outbi.biWidth = n*bi.biWidth; outbi.biHeight =n* bi.biHeight; // determine padding for scanlines int padding = (4 - (outbi.biWidth * sizeof(RGBTRIPLE)) % 4) % 4; int ...
0
votes
0answers
42 views

resize: issue with sending cursor back

recently I have been working on resize problem of CS50 Course. I am stuck at I believe last step, but I just dont know how to solve this. Can somebody help me please? I think that the issue is with ...
0
votes
2answers
71 views

Problem with CS50 Pset3 Resize Less

The issue that keeps occurring after compiling and running the file, is that the resulting output bmp file changes to an unsupported file format(as stated when clicking on the bmp image file after ...
0
votes
1answer
83 views

pset3 resize less

I'm having some problems and cannot seem to find the bugs. The program seems to function correctly but cs50 check says that the file is too large. Would love to have someone to look at my code and ...
0
votes
1answer
27 views

PSet3 Resize (Less) = Random Colors when not 1:1

I saw others posted about the same phenomena I am experiencing, but none of their solutions were what I needed. n = 1 works perfectly. This is large.bmp with an n = 2. I realize the first line of my ...
1
vote
1answer
82 views

PSET3- Resize (Less)- Problem resizing horizontally

I've been stuck on this problem for over a week now, and even after reading answers to a few similar questions, I'm not getting where I'm going wrong :( Watching the walkthrough, I wasn't quite sure ...
0
votes
1answer
20 views

Taking scale factor input in Resize--pset3

I'm trying to take an input integer between 1 and 100 and store its value as n, which I will then refer to as the scale factor, and use it later on in the redefinition of bi.biWidth *= n; and in ...
0
votes
1answer
48 views

CS50 - Pset3 - Resize (Less) - Wrong Bitmap Size

Could someone please review my code for Resize (Less) pset? My code resized everything correctly before I added a couple of extra variables and changed some things up, so I had some base sizes that ...
0
votes
1answer
38 views

resize pset3 i'm having a problem with the downsizing

so my program is working correctly the only problem is with the downsizing i can't make it work correctly here is my code #include <stdio.h> #include <stdlib.h> #include <stdlib.h> #...
0
votes
1answer
53 views

In pset3, why do we write #include “bmp.h” and not #include <bmp.h>?

In pset3, I noticed that while cs50.h and stdio.h were included the usual way we encountered so far, bmp.h was included differently. I'm guessing bmp.h is not a part of the standard header files that ...

1 2 3
4
5
25