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
1
vote
0answers
11 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
0answers
9 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
23 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
2answers
83 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
46 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
24 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
14 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
11 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
34 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
12 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
36 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
19 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
25 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
24 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 - (...
0
votes
1answer
23 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
34 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
0answers
34 views

Resize not working properly [closed]

I am trying to resize a bmp..but the program only works for a resize value of 1. it gives wrong pixel colors for the enlarged/compressed image..but it does produce a bmp in that case also.. int main(...
0
votes
1answer
39 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
2answers
62 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
17 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
25 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
33 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
62 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
34 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
40 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
30 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
53 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
18 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
38 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
65 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
38 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
22 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 ...
0
votes
0answers
36 views

Don't understand what I'm missing in Recover Code

So far I am able to recover the 50 files needed but I have no idea why I keep getting checkered images instead of the intended ones. I'd really appreciate any insight into what I'm doing incorrectly. ...
1
vote
1answer
57 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
35 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
32 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
32 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 ...
0
votes
1answer
49 views

PSET3 - Resize (Less) : Random colours being printed?

Going through the walkthrough of 'Resize (less)' and currently trying to resize horizontally. When running resize, only a few pixels have the correct colour and others have completely random colours. ...
0
votes
2answers
26 views

Intuition for what is statically allocated memory vs dynamically allocated memory

So I'm just finishing Lecture 3, and even after research, I can't get a visceral handle on the difference between the two. Yes, I know that one is in stored in the heap, and the other in the stack, ...
0
votes
1answer
81 views

What's wrong with this recover code?

I wrote some code for recover that seems to me to be recovering the image correctly (I can see pictures of people for all 50 images), but for some reason, check50 says that 049.jpg does not match the ...
0
votes
1answer
49 views

I can't figure out the problem in my resize (more) code

I was actually able to solve resize (more), but I'm not able to figure out what's wrong with one of my previous codes (the one I was stuck for longest on) This is my old code: #include <stdio.h&...
0
votes
0answers
21 views

Pset3-Resize: Problem with downloading ZIP file in IDE

I have problems downloading the ZIP file that contains the starter code. It kept saying failed: connection time out. I've even tried to switch to a different WIFI but it's still not working. The code ...
0
votes
1answer
24 views

pset3 Resize: Header values not copying into outfile

My output.bmp file yields "Invalid or Unsupported Image Format", and using ~cs50/2019/x/pset3/peek output.bmp yields "Could not recognize output.bmp". Using check50 also gives the error "Header field ...
0
votes
1answer
53 views

jpg's are not proper, mix of multiple images. Can anyone tell me whats wrong?“RECOVER”

here is my code while (fread(buffer, 512, 1, inptr) == 1) { if (buffer[0] == 0xff && buffer[1] == 0xd8 && buffer[2] == 0xff && (buffer[3] & 0xf0) == 0xe0) ...
0
votes
1answer
42 views

resize : pset3 not all colors are appering after resizing

so im trying to resize an image of green square that has a smaller white square inside it and when i do the resizing the green square resize but the white one disappears i'dont know where the problem ...
0
votes
1answer
49 views

PSET3 Recover - Creating only textfiles for .JPG not images

My version of Recover for pset3 is creating 50 .jpg files but only as textfiles not images and I can't work out why. I've looked through this forum and saw one similar question but the issue ...
0
votes
1answer
29 views

pset3 Resize - Invalid or unsupported Image Format

So i think i finished resizing horizontally but when i try to open the output image to check i get an error saying "Invalid or unsupported Image Format", I read other similar questions here and i ...
0
votes
1answer
58 views

PSET3 Recover: My code works when I make the buffer an array, but not when I use malloc

My code works perfectly when I make the buffer I use in fread and fwrite an array of unsigned chars, but when I use malloc to allocate memory space I get segmentation faults (this is the opposite of ...
0
votes
1answer
60 views

pset4 recover - doesn`t recover all files

Struggling with recover at this moment. My code creates just 8 pictures out of 50 - from 2nd to 9th. Other jpegs are also made but i am unable to see them due to "Invalid or Unsupported Image Format". ...