Questions tagged [cs50x]
The cs50x tag has no usage guidance.
1,071
questions
0
votes
1
answer
12
views
Trivia Lab 8 Week 8 - Issues with Free Answer Question
My "Check Answer" button doesn't work for the free response question. I followed the "Not sure how to solve?" video so there might be have been a problem while copying it over.
...
0
votes
0
answers
11
views
What does 'NoneType' error mean?
In finance, I am getting the following error:
sending POST request to /register
exception raised in application: TypeError: expected string or bytes-like object, got 'NoneType'
Is this related to the ...
0
votes
1
answer
7
views
Lab 5 - Inheritance check50 error
Attempted CS50 Lab 5 inheritance. My code looks correct and compiles. I also double-checked with Brian's solution and they were identical. Yet when I passed it through check50, I got multiple errors ...
0
votes
1
answer
13
views
What link can I use to download a CS50 coding environment in order to practice as the class goes on?
I want to be having a hands on coding practice as the class goes on. I was only able to download a helpful App for the very 1st class- Scratch.
From subsequent class (that is, from C), a couple of ...
-1
votes
0
answers
12
views
pset9 TypeError: 'NoneType' object is not subscriptable
i am stuck on this for a day and gave up finally! why is this error occuring! tried all sorts of debugging! even open ai is like it's fine! also when i use the website there is no error but cs50 check ...
0
votes
0
answers
12
views
CS50 Finance Index
Hello can someone please check my code. I keep getting going round and round changing stuff but its alway a keyerror: symbol or something else. Thank you
@app.route("/")
@login_required
def ...
0
votes
2
answers
8
views
can anyone help error check my luhns algorithm code?
i wrote this version of the credit card number checking code and it still gives me an error when i check it.
apparently, it validates 4111111111111113 and 4222222222223 as visa numbers when theyre not....
0
votes
1
answer
4
views
p is assigned a memory first but when create family is called again, isnt the last memory lost as now p points at a new chunk of memory?
person *p = malloc(sizeof(person));
// If there are still generations left to create
if (generations > 1)
{
// Create two new parents for current person by recursively calling create_family
...
0
votes
1
answer
14
views
Incorrect blur for filtermore
for this problem, I have opted to use a strategy where I create a 1 pixel border in a copy image with RBG values = 0, to avoid running into segmentation errors when trying to access a pixel. I also ...
0
votes
1
answer
17
views
PSET2 Caesar help - Rotate function
I have been getting the error message "expected identifier" for line 65 of my code pointing to the isupper function below. I can't see what I am doing wrong and any help would be appreciated ...
0
votes
1
answer
30
views
HELP! Speller segfault
my speller code compiles but it gets segfault.
I'm not sure where I went wrong, my guess is load but I'm not sure.
#include <ctype.h>
#include <stdbool.h>
#include <strings.h>
#...
0
votes
0
answers
19
views
Finance question. expected status code 200, but got 400 for register route
@app.route("/register", methods=["GET", "POST"])
def register():
"""Register user"""
if request.method == "POST" :
...
0
votes
1
answer
21
views
filter-less blur function
I am stuck at pset4 filer-less, blur function. The duck and chatgpt say that my code is correct but it doesn't give excepted outputs in any of Check50 result for blur function.
//Blur image
void blur(...
-1
votes
0
answers
21
views
Hi Guys! This is my terminal status please help me to solve this error
I have been facing this problem for several days!
This is my terminal status:
mkdir: cannot create directory ‘/home/ubuntu’: Permission denied
codespaces-289bca:/workspaces/143489709/CS50X/PSET5/...
0
votes
1
answer
19
views
Issues with readability functions
I am having difficulty getting past creating the first function of my code, line 61. I have tried many different variations and I suspect that I am just not understanding a basic concept of the ...
0
votes
1
answer
39
views
game.py rejects out-of-range level expected program to reject input, but it did not!
Here's my code:
while True:
try :
level = int(input("Level: "))
# guess = int(input("Guess: "))
except ValueError:
pass
...
0
votes
1
answer
33
views
Credit : the checksum is correct for <10 digits, but for14,15,16 digits getting negative checksum
The checksum is correct for less than 10 digits but for 14-16 digits it is coming back negative. What am I doing wrong?
#include <cs50.h>
#include <stdio.h>
#include <math.h>
int ...
0
votes
1
answer
28
views
expression result unused on a subtraction symbol in a do-while loop
popGrowth.c:12:17: error: expression result unused [-Werror,-Wunused-value]
do x + (x/3)-(x/4); while (x < y);
~~~~~~~~~^~~~~~
Overall I am trying to complete an action to a start ...
0
votes
2
answers
35
views
pset4 blur; artifacts on a white parts of an image
I believe I've done this part of filter-more task pretty well, but, unfortunately, an output image has some artifacts - blur works badly with white parts of an image.
void blur(int height, int width, ...
0
votes
1
answer
11
views
runoff is_tie and print_winner
I'm having a hard time seeing where I went wrong with my two functions IS_TIE and PRINT_WINNER
when I put my code through check50, for print_winner I get: "did not print winner of election" ...
1
vote
1
answer
19
views
Practice Problem 4: error: incompatible pointer types passing 'char *[7]' to parameter of type 'char *' [-Werror,-Wincompatible-pointer-types]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
// Check for command line args
if (argc != 2)
{
printf("Usage: ...
0
votes
1
answer
34
views
pset 5 speller do not pass check 50
I do not know what I am doing wrong. Please, give me a hint.
Here is my solution from check50:
:( spell-checking is case-insensitive
Cause
expected "MISSPELLED WOR...", not "MISSPELLED ...
0
votes
0
answers
38
views
reverse isn't properly reversing the file
The audio file that is generated not reversing the audio correctly. Here is the code:
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "wav.h"
int ...
0
votes
1
answer
45
views
pset5 speller cannot read number of word in dictionary
thank you for clicking. Being concise, I have the right solution for the pset, as evidenced down below by comparing my solution to the staff's, but check50 insists that no words have been loaded into ...
0
votes
0
answers
17
views
CS50 Cybersecurity - Difference between Verified Track and non-verified track
In CS50’s Introduction to Cybersecurity, what's the difference between verified and audit track? If audit the course, will I be able only to see the lectures (but can't submit some of the assignments)?...
0
votes
1
answer
32
views
Pset4- recover: recovered jpgs appear to be empty
I tried to implement recover through the simplest and shortest way I could imagine.
The code compiles and saves 50 JPGs with proper names, but when I open them, all of them are just empty and even ls -...
0
votes
1
answer
29
views
Pset5 Speller - Weird Load Function Bug (Edited w/ Code)
bool load(const char *dictionary)
{
// TODO
FILE *fdict = fopen(dictionary, "r");
if (fdict == NULL)
{
return false;
}
// create container string to hold ...
0
votes
2
answers
37
views
CHECK50 Passes, but I Get 6/7 When Submitting
I've just completed pset4 - recover.
I did quite a bit of debugging and was finally able to pass all checkmarks with check50, style50 and Valgrind. After submitting I checked my grade and I received 6/...
0
votes
2
answers
59
views
cs50 license memory free
Was trying to free memory using the for loop,
for (int i = 0; i < sizeof(buffer); i++)
{
free(p[i]);
}
but got this error
license.c:46:14: error: incompatible integer to pointer ...
0
votes
1
answer
31
views
Recover PSET 4 Week 4 - skipping while loop
This is a follow up to my previous question. After I went through my code on debug50 it shows that my while on line 35 is not going through. I checked my code with other others on this site and they ...
0
votes
0
answers
38
views
cs50 Duck Debugger button missing
my cs50 ddb missed after I rebuild my codespace, and i tried to download one from extension shop but then i found that i cannot run it correctly since it just keep saying quack😢.
I wanna know what's ...
0
votes
1
answer
9
views
i cant convert the folder to binary folder
$ make hello
error: error reading 'hello.c'
1 error generated.
make: *** [: hello] Error 1
$
-1
votes
1
answer
33
views
CS50 PSET 4 Recover - segmentation fault and blank file
I have been trying to solve this question for a while now but I am still not sure what is wrong. The program works fine before the while loop but after it stops working and when checking with check50 ...
0
votes
0
answers
11
views
how to add the cs50 library to eclipse
I've been struggling with adding the cs50 library to eclipse. Could someone provide step by step instructions for how to do this on windows. I have C running with the MinwGW compiler.
this link and ...
0
votes
2
answers
26
views
Problem set 2 , Passes all tests when submitted but only give 2/11 grade
check50 results in all the tests passing but also produces a repetitive error, Invalid key. Please provide a positive integer. Cause Timed out while waiting for program to exit. Not sure which line ...
0
votes
1
answer
49
views
CS50 Week 9 - Finance: How do I save the date and time with SQL?
I'm trying to make a new column in my database where I can save the date and time of the purchase. Am I using the datetime function(?)
ALTER TABLE purchases ADD timedate DATETIME NOT NULL DEFAULT ...
1
vote
0
answers
62
views
I am trying to solve my Einstein Code
I have written the following code and no matter what I try, the check always fails.
Here is my code:
user_input=int(input("Give Your Mass in KG to Find E=mc^2 = "))
c = 300000000
d= int (...
1
vote
1
answer
38
views
Man pages not accessible from VSCode for CS50
I get this message with commands such as man printf :
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.
To restore this ...
-1
votes
1
answer
31
views
Pset 4 Filter (More) -- PLZ HELP
When I declare the array earlier, I end up with the wrong output. But when I declare it inside the loop, the final output is correct.
Plz tell me how to explain this.
The wrong one:
void edges(int ...
0
votes
1
answer
25
views
hey im on pset2 readability. i cant seem to get the right output. it is supposed to show letters= and words= but its not
#include <stdio.h>
#include <cs50.h>
#include <string.h>
int count_letters(string text);
int count_words(string text);
int count_sentences(string text);
int main(void)
{
// Get ...
0
votes
0
answers
31
views
Error in cs50 reverse pset week 4
guys im not able to debug my reverse pset from week 4 .There are eight #TODOS in the code but my code in #eight TODO is give these errors:
***:( reverse.c creates an output file
timed out while ...
0
votes
1
answer
63
views
DNA Week 6 | Issues
I have been working on this DNA problem for a while now, and I do not understand what causes the many problems. Right now there are just some technical problems, for example saying "No match"...
1
vote
1
answer
255
views
Lab 6 World-Cup | Timed out issue
Check50 says, and I qoute, "timed out while waiting for program to exit" in some of the criterias, I don't understand what infinite loop is causing this. Can you help?
# Simulate a sports ...
2
votes
1
answer
66
views
PSET9 keeps returning no results
I am trying to submit my pset9 Finance problem but I keep getting "no results" even though my tests checking accordingly. What could be the issue
0
votes
1
answer
30
views
Problem with my code (Problem Set 1 - Credit)
#include <cs50.h>
#include <stdio.h>
int checksum(long n);
int main(void)
{
long card_number;
int k;
// Prompt user for card number
do
{
card_number = ...
0
votes
1
answer
13
views
Code for pset5 compiles, but produces no OUTPUT. Seems like it is stuck in infinite loop
Description of Problem:
Hey guys, so my code is outputting only MISSPELLED WORDS and then it apparently gets stuck in an infinite loop. So that I have to type ctrl + C to be able to type anything in ...
0
votes
1
answer
22
views
My code look correct and work correctly for all other sequence but check50 says sequence/18 is wrong, expected "No match" not harry
import csv
import sys
global y
def main():
y = 0
x = 0
t = 0
# Check for command-line usage
if len(sys.argv) != 3:
sys.exit("Usage: python dna.py data.csv sequence....
0
votes
1
answer
24
views
Speller works fine up until a certain point
My speller program has an issue where it will find what words are misspelled properly, but it won't give the data of the amount of words misspelled/ in the dictionary/ in text. Running Check50 shows ...
0
votes
1
answer
49
views
make: *** No rule to make target 'hello'. Stop
I recently started the cs50 2023 course, and from the beginning I faced problems
When I type "hello world" code, I get this error
make: *** No rule to make target 'hello'. Stop
What is the ...
0
votes
0
answers
6
views
I have an issue with my code in Pset4 Recover: It compiles right and makes all 50 needed images, yet there's no data seemingly in any of the images
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// Defining a datatype for BYTEs
typedef uint8_t BYTE;
int main(int argc, char *argv[])
{
if (argc != 2)
{
printf("...