Questions tagged [cs50x]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

How do I change if/else if statements into a loop?

I cannot figure out how to change the following code into a loop. This is just a portion of a larger code where n is defined by user input. How do I create a loop that adds one "#" to each ...
0
votes
1answer
8 views

Git hub on Chromebook

So, I've been doin Harvard's intro to computer science I passed week 0 an was pretty much done with week 1 when it said I couldn't run check 50 cause I hadn't authorized it. It gave me a link but I ...
0
votes
0answers
9 views

Tideman lock_pairs function

I'm working on the lock_pairs function, and what I do is creating another function called "cycle" to check whether each pair is going to create the cycle. If it will create the cycle, this &...
0
votes
0answers
6 views

Getting a segmentation fault on cs50's filter

I'm currently stuck on cs50's pset4 filter (less comfortable). The program compiles perfectly. I have tried out the first three parts of the code (grayscale, sepia & reflection) and their output ...
0
votes
1answer
6 views

Why is my C modulo code giving repeating identical output?

I am wondering why my output repeats before it gets to the final output: #include <cs50.h> #include <stdio.h> #include <math.h> int main(void) { long bignum = 4300123488893756; ...
0
votes
1answer
20 views

CS50 Final Project Help: SQL QUERY…inserting row from one table into another table after button pressed

I have nearly finished the Cs50x course but I am stuck on my final project. I am creating a website called 'Letterbooks' (inspired by Letterboxd) that allows you to log books that you have read. I am ...
0
votes
1answer
35 views

Indexing problem

when debugging, the inner-most if condition never entered. Whether the char is upper-text or lower text. I 'm using the same methodology in both cases. // testing if the char upper text if ...
0
votes
1answer
19 views

CS50 - PSET 4 - Filter - Edges

//Pixel buffer RGBTRIPLE pixelBuffer[height][width]; //Iterates on every pixel and calculates Gx and Gy for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++)...
0
votes
1answer
17 views

Week 2 Lab (Scrabble)

This is my code: #include <ctype.h> #include <cs50.h> #include <stdio.h> #include <string.h> // Points assigned to each letter of the alphabet int POINTS[] = {1, 3, 3, 2, 1, 4,...
0
votes
0answers
9 views

How can I receive a string from the user to tokenize without having to initialize the array with a constant?

The string in question is names1[] that is initialized with "Anya Ava Sam Mark" int main() { char names1[] = "Anya Ava Sam Mack"; char delim[] = " "; ...
0
votes
0answers
6 views

Error with calculating Egdes in Pset4 Filter (More) Detect Edge problem

// Detect edges RGBTRIPLE new_pixel(int i, int j, int height, int width, RGBTRIPLE image[height][width]) { int redx; int bluex; int greenx; int redy; int bluey; int greeny; ...
0
votes
0answers
31 views

Pset4 - Filter - Blur- some pixels have RGB 0 0 0

I've been struggling with the filter portion of problem set 4 for quite a while. In particular, I've had a particularly persistent bug. As you can see from the Check50 screenshot below, some RGB ...
0
votes
1answer
22 views

Trivia | Uncaught TypeError: correct.addEventListner is not a function

Inside the script tag there was a error: Uncaught TypeError: correct.addEventListner is not a function at HTMLDocument. (index.html:14) Please help me fix it here's the code: var correct = document....
0
votes
1answer
26 views

I have to enter any letter to get the result

I am currently doing the problem set 1 credit in cs50 program. I managed to write the code. It's compiles fine however once I enter the credit card number it stops, i must type any letter to get the ...
0
votes
2answers
35 views

Pset4 Blur (filter less) not passing check50

As title says, I am not passing check50 for blur. I am aware that my method is probably extremely tedious and not the best method, but I came up with it myself and would like to find out why it isn't ...
0
votes
1answer
33 views

pset4 - (Filter Less ) - Doubts with malloc()

I'm performing the problem set from pset4 to the (filter less) part. I wish to use malloc() to my advantage to speed up image filtering and maybe check50 will accept my solution to the problem. I ...
1
vote
1answer
30 views

Recover - segmentation fault and other general problems

Hey guys so I've hit a bit of a wall with Recover, when I run my program I get segmentation fault but I also don't know how to end off one jpeg when another header pops up? In essence, I'm not sure ...
0
votes
1answer
14 views

Not able to link cs50x with Edx

I'm new here. I just started the Edx cs50 course and submitted the first problem. When I go to https://cs50.me/cs50x I get to see the following error: Your CS50.me account is not yet linked with edX. ...
0
votes
1answer
40 views

Lab 5 Check50 Error Question

When I run Check50 I get an error. I have watched the hint video and my code matches what is shown. I have attached a screenshot of my error as well as the code below. Thank you for the help! person *...
0
votes
1answer
21 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
35 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
1answer
46 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
8 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
29 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
46 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
52 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
12 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
41 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
41 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
26 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
28 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
29 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
28 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
223 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
235 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
60 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
34 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
25 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
19 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
178 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
49 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
14 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
14 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
23 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
72 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 <...

1
2 3 4 5
17