Questions tagged [cs50x]

The tag has no usage guidance.

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

PSET 8 Finance “:( buy handles valid purchase exception raised in application: TypeError: 'method' object is not subscriptable”

I've been having a problem with CHECK50, I cant seem to find the right object to change. This is the log I get sending GET request to /signin sending POST request to /login sending POST request to /...
0
votes
1answer
10 views

API key or look up function error in cs50 finance pset9?

I was working on the implementation of buy and trying to buy stocks when all of a sudden I began receiveing incorrect/invalid stock symbol for every stock symbol I tried(as if the stock symbol was not ...
0
votes
0answers
5 views

PSET3 Tideman - What to do with the lock_pairs function?

Can someone please help me with the lock_pairs section of the problem? The lock_pairs function is killing me. I get that you have to compare the pairs to each other and then return false or true in ...
0
votes
0answers
7 views

CS50 Games - Am I able to use the latest version of Unity and Blender for the final?

Hello I am going to create a game using Unity, but I would rather update to the latest version than try to learn a 2-3 year old version.
0
votes
0answers
15 views

CS50 final project // LOVE lua bullet following player when shot (space shooter)

So I implemented a shoot function into my game where the spaceship can shoot a bullet every time I press space but the problem is that whenever the bullet is shot out if I move my character at the ...
0
votes
1answer
24 views

Recover code makes 000.jpg to 049.jpg, but jpgs are corrupt

I've been working on this problem for a little bit, but right now I have no clue why my code isn't working. Right now it spits out the 50 jpgs like it's supposed to, but they're all blank. Anyone have ...
0
votes
1answer
24 views

Credit (Pset1) - Checksum problem

so I have a problem with the Credit exercise from pset1. I updated my code today after realizing that I didn't split up the digits of the product of the current digit in the card number and 2 and ...
0
votes
1answer
38 views

pset6 DNA // having problem comparing elements from the database and the sequence file

Hi there I am having an issue comparing the data I have extracted from the sequence and the database files for now I am doing a sort of in efficient way but later I will fix it I am not sure really ...
0
votes
1answer
8 views

In Recover, when I run check50, it says timed out while waiting for program to exit. But when I run it with ./recover card.raw, it works perfectly

#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int check_jpg(BYTE array[]); int main(int argc, char *argv[]) { if(argc != 2) { ...
0
votes
0answers
13 views

pset9 finance // expected to find “112.00” in page, but it wasn't found [duplicate]

Hi I was testing out my code for the buy function to buy a stock but once I tried to buy a stock it gave me this error: expected to find "112.00" in page, but it wasn't found and I am not ...
0
votes
1answer
12 views

pset9 buy function // buy handles invalid ticker symbol and handles valid purchase having error

I ran check50 to check some things that were wrong and I got 2 errors but when i check the details of the error it doesnt really give me a detailed overview of the problem so I am not really sure how ...
0
votes
1answer
23 views

pset9 finance // index function doesnt display the sum of the shares

I am doing pset9 finance and I am kind of stuck because whenever I buy for example FB stocks multiple times it doesn't sum up in to show in the index function. this is the code: @app.route("/&...
0
votes
1answer
22 views

pset9 finance // how can I check whether someone has registered

I ran a check50 and i found that its not checking if the user is in the database when registering so i decided to put a if statement which checks if the user is not added but it gives an error and i ...
0
votes
2answers
22 views

Readability Wrong Output at Index around 7-8

I have been struggling with Week 2 Problem Set 2 Readability Question. At this point, I feel like I am stuck, and spend too much time just trying to fix one error. The code works perfectly except &...
0
votes
1answer
15 views

pset9 // register function not registering user

I am having this problem with my register function in pset9 when i register on the web app it says error 500 internal server error and when i check my terminal it says: return self.view_functions[rule....
0
votes
1answer
27 views

Problem set 5 - is this the correct way of inserting into a hash table?

So far I've been unable to get the dictionary to load properly in the speller problem set. The goal is to insert every word from the dictionary into a hash table. Is what I'm doing in the the line ...
0
votes
1answer
86 views

Lab 8 // Resetting button colors not working properly

I am doing the lab 8 trivia question and I am try to reset all the colors of the buttons when you press another from the rest. I am not sure how to do it. I have the function for resetting the colors ...
0
votes
1answer
14 views

PSet3 Tideman , error with updating ranks array

bool vote(int rank, string name, int ranks[]) { for (int i = 0; i < candidate_count; i++) { if (strcmp(name, candidates[i]) == 0) { ranks[rank] = name; ...
0
votes
1answer
126 views

pset7 Fifty Ville // not sure how to get the intersect of cases to find the thief

I am currently doing pset7 and I have found most of the clues of who it is but the problem is that I need to use the intersect sql function to find the common name of the thief but I am not sure how. ...
1
vote
1answer
35 views

pset3, tideman, cs50 2021

I worked with pset3 and I think there are nothing wrong with my code, but check 50 says it has 2 problems on my code. 1.:( lock_pairs skips final pair if it creates cycle 2.:( lock_pairs skips middle ...
0
votes
2answers
26 views

Check50 accepts all but last 2 tests. pset1/credit

I've been trying to fix this on my own for a bit but I wasn't able to find an answer online. My credit program passes all check50 test's except for the last two (identifies 4111111111111113 as INVALID ...
0
votes
0answers
23 views

Problem incrementing vote in plurality

EDIT: I FIGURED IT OUT AND IT IS NOW WORKING. My code does not increment the vote. It correctly prints the invalid vote- but its not increment the vote at all. #include <cs50.h> #include <...
0
votes
1answer
16 views

PSET4 Filter less BLUR

I want to check if the array exists for the edges so I've been trying to check if the block is NULL. if (image[i-1][j-1] != NULL); { redAverage+=image[i-1][j-1].rgbtRed; ...
0
votes
1answer
108 views

CS50 (2021) - Finance. :( registration rejects duplicate username - expected status code 200, but got 400

I´ve been struggling to complete the Pset9 - Finance, version from 2021. After reading multiple threads I decided to post here the issue, looking for some guidance so I can move forward in the course. ...
0
votes
1answer
37 views

incompatible pointer types error

I'm working on lab5, inheritance, and I'm trying to decipher why I'm getting this error when trying to compile: inheritance.c:52:32: error: incompatible pointer types assigning to 'struct person *' ...
0
votes
1answer
13 views

Plurality test passing on all except one

#include <cs50.h> #include <stdio.h> #include <string.h> // Max number of candidates #define MAX 9 // Candidates have name and vote count typedef struct { string name; int ...
0
votes
1answer
12 views

When I'm creating array

This has me confused. In the following code, I create an array of characters initialized at size 7. The array needs to store at least 6 characters, so I've made it large enough to do that (I think?). ...
0
votes
1answer
21 views

Pset4 Recover debugging help: “While loop has empty body”

I'm working on the Recover problem, and I'm unable to fix this error I'm getting when trying to compile: "while loop has empty body" If you look at my code I think what should be happening ...
0
votes
1answer
51 views

lab 5 // issue when freeing family memory

Hi I have an issue with freeing the family memory in my code: when I run my code the issue seems to be from the free memory for the parents section but I am not sure what's wrong void free_family(...
0
votes
1answer
31 views

pset5 - speller - recursion

// Implements a dictionary's functionality #include <stdio.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include "dictionary....
0
votes
1answer
25 views

Recover - PSet 4

I am for some reason unable to generate any jpgs with my code; I think there's a mistake in the logic somewhere? Would be very grateful for some hints! Thank you! #include <stdio.h> #include <...
0
votes
0answers
8 views

Gradebook does not update after pset submission

I am currently on Week4, but my grade book seems not updating since 2 days ago, after I have submitted pset4 - Filter (More). I have just submitted pset4 - Recover, tho problem sets have shown in my ...
0
votes
2answers
32 views

Runoff Help: Tabulate Handles Multiple Rounds of Preferences

I cannot figure out why I am getting rejected on check50 for ":( tabulate handles multiple rounds of preferences - tabulate function did not produce correct vote totals". I get green ...
0
votes
1answer
180 views

Lab 2 Double free or corruption error

I am working on scrabble.c for Lab 2 and was able to compile and run the code but for some of the words, there is this error: double free or corruption (out) Aborted (core dumped) I tried to google ...
0
votes
1answer
19 views

Input Problem in Char 'P' PSET2 Substitution

QUESTION When i put cipheralgorithm (which is a function that is making encryption) in comment section (/*) everything goes perfect i can get input when i type ./substitution ...
0
votes
0answers
25 views

pset4 - filter - less - blur doesn't work

// Blur image void blur(int height, int width, RGBTRIPLE image[height][width]) { //Temp array RGBTRIPLE temp[height][width]; for (int i = 0; i < height; i++) { for (int j = ...
0
votes
2answers
190 views

is this error or not in CS50X lab activity

In lab activity of week0 of CS50X 2021, I have found this logical error. The system is so programmed by the university to expect output 2 for the following inputs but actually, it must be 1 because ...
0
votes
1answer
31 views

pset4 - filter(less) - sepia not working

void sepia(int height, int width, RGBTRIPLE image[height][width]) { for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { float redS = .393 * (...
0
votes
1answer
22 views

pset4 recover creates 50 images but bytes don't match up

My code creates the 50 files, all of them starting with the correct JPEG signature, however the rest of the bytes don't match up. In other words, first 4 bytes are correct, the following bytes are ...
0
votes
1answer
29 views

speller is case sensitive

I tried to convert each word to lower before hashing in check, but it seems like it didnt do anything :( however, in the output the misspelled word is now lower // Implements a dictionary's ...
0
votes
1answer
17 views

speller getting different hashes in check and load

using some printf statements to debug it seems that when I hash a word in my load function I get a different value then when I hash it in my check function, even when the words are the same case. I'm ...
0
votes
1answer
25 views

speller returning a segmentation fault, unclear why

this is my dictionary.c implementation. I think the problem is speller since I've been printing my hash values from hash. I also have not yet implemented unload since I think I'm having some ...
0
votes
0answers
8 views

Pset4_ Blur: (more comfortable)Problem, I think there is a small bug, but I can't find it

I was working on my code(sorry for it being so long), then I kept getting the same error and I don't understand why :) blur correctly filters middle pixel :) blur correctly filters pixel on edge :) ...
0
votes
1answer
20 views

Program compiles and produces required output in caesar from CS50 but segmentation fault due to lack of memory. What to do next?

My program compiles and produces the required ciphertext in caesar problem but when the input has too many characters, I get a segmentation fault after a specific number of ciphertext characters are ...
0
votes
1answer
45 views

Pset8 Finance Register HTTP 500 error

I am working on the Finance PSET8 and am having trouble with the Register part of the problem. This is my application.py code: @app.route("/register", methods=["GET", "...
0
votes
0answers
11 views

cs50 pset 4 filter less help!

this is my code void blur(int height, int width, RGBTRIPLE image[height][width]) { RGBTRIPLE map[height][width]; for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { float ...
0
votes
1answer
10 views

pointers and addresses

int m=10; int *ab=&m; printf("address of *ab:%p\n",&*ab); printf("adress of ab:%p\n",&ab); output: address of *ab:0x7ffd85fddefc adress of ab:0x7ffd85fddf00 i ...
0
votes
1answer
25 views

PSET 4 Recover.C wrong exit code?

Currently getting the following errors when working on pset4 for the class CS50. Not sure why my exit code is none? Please let me know if you guys know what the issue is. Thank You. :) recover.c ...
0
votes
1answer
13 views

when to search in binary search right, when left?

in the binary search algorithm: If no items Return false If middle item is 50 Return true Else if 50 < middle item Search left half Else if 50 > middle item Search right half like can we do the ...
0
votes
1answer
33 views

CS50 Pset3 Plurality

I have issues compiling my program since the last two checks for checkcs50 wont work. It says:problem withprint_winner function did not print both winners of election :( print_winner prints all names ...

1
2 3 4 5
17