r/cs50

▲ 5 r/cs50+4 crossposts

I am pcmb student and going for cse ,,, what should i learn in these two months,,, how to and where to learn programming basics

reddit.com
u/Quiet_Resolution7185 — 17 hours ago
▲ 3 r/cs50

help for week 4 filter-less check50

helpss!! i've only modified helpers.c and didn't touch any other code but check50 always runs:

:( filter compiles

expected exit code 0, not 2

then i tried deleting whatever code i written in helpers.c and then check50 didn't return the exit code error anymore.

did anyone face the same issue?

p.s. i thought i modified other code so i redownloaded and unzipped the distribution code and made sure i didn't open any other files except for helpers.c and i still got the same result :(

reddit.com
u/Popular-Spinach-2770 — 14 hours ago
▲ 2 r/cs50

cs50 check50 error

When i run check50, even tho the outputs are correct yet it shows error message "timed out while waiting for program to exit", how do i fix this?

u/DarkDesperate9490 — 1 day ago
▲ 6 r/cs50

Doubt .. am a beginner..

I donno whether I should watch all the intro videos or no .. I wanna be a game dev so donno the next path.. kindly replyCan u tell wt should be my next step after introduction to cs in cs50 . I m beginner

reddit.com
u/ImpressiveTwist3601 — 2 days ago
▲ 10 r/cs50

Stuck with a single error on CS50P

I am doing Week 3's Fuel Gauge problem set, and I am hardstuck with just one error. All other checks passed except this one, I don't know what I'm missing, can anyone give me some tips? Here is my current code:

u/seraphlike — 2 days ago
▲ 2 r/cs50

Want a help in recover problem set

Every time I run check 50 in the terminal it always tells me that :

:( recovers 000.jpg correctly

000.jpg not found

:( recovers middle images correctly

001.jpg not found

:( recovers 049.jpg correctly

049.jpg not found

:| program is free of memory errors

can't check until a frown turns upside down

But I don't know how to solve that yet . Can anyone help me in that?

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>


int main(int argc, char *argv[])
{
     // Accept a single command-line argument
     if(argc != 2)
     {
        printf("usage: ./recover FILE\n");
            return 1;
     }


    // Open the memory card
    FILE *card = fopen(argv[1], "r");
    if(card == NULL)
    {
        printf("Couldn't open the file\n");
    }
    //Create a buffer for a block of data
    uint8_t buffer[512];
    // While there's still data left to read from the memory card
    char *recard = malloc(3 * sizeof(char));
    int i = 0;
    int if1st = 0;
    FILE *img;
    while(fread(buffer, 1, 512,card) == 512)
    {
        // Create JPEGs from the data
        if(buffer[0] == 0xff && buffer[1] == 0xd8 && buffer[2] == 0xff && (buffer[3] & 0xf0) == 0xe0)
        {
            if(if1st == 0)
            {
                sprintf(recard, "%03i.jbg", i);
                img = fopen(recard, "w");
                fwrite(buffer, 1, 512, img);
                i++;
                if1st = 1;
            }
            else
            {
                fclose(img);
                sprintf(recard, "%03i.jbg", i);
                img = fopen(recard, "w");
                fwrite(buffer, 1, 512, img);
                i++;
            }


        }


    }
    fclose(card);
    free(recard);
}
reddit.com
u/Beautiful_Welder5374 — 2 days ago
▲ 16 r/cs50

What to do after CS50python

I’m trying to master python by the summer any recommendations on what to do after completing CS50 python. I do leetcode sometimes and just started working on GitHub repo 30 days of python, but I was wondering if there are better ways to master it faster.

reddit.com
u/GetYoDogAhOn — 3 days ago
▲ 2 r/cs50

Credit Credit Credit

Hello hello. On my 2nd day of doing cs50 while my uni has finished for the summer, and I'm stuck on credit :/

In short I can get my code to print each digit of the credit number individually using a loop but I can't figure out how to store each output as a variable for later use.

long cred = get_long("Number? ");

long test = cred;

while (test > 0)
{
    long digit = test % 10;
    test /= 10;
    printf("%li\n", digit);
}

Ideally instead of printing the digit on line 9, I'd like to be able to set it to a new variable on each loop. Is this possible?, and if so, how could I do that?

reddit.com
u/Electronic_Click_470 — 2 days ago
▲ 3 r/cs50

cs50 python little professor question

So this is the code I wrote for the little professor problem. It seems to work properly, however when I checked it through check 50, I got a part flagged wrong that I'm having a difficult time understanding what it means and how I could fix it.(picture tagged below) Can somebody help me out?



import random


def main():
    generate_integer(get_level())




def get_level():
    levels = [1, 2, 3]
    while True:
        try:
            level = int(input("Level: "))
        except ValueError:
            continue
        if level not in levels:
            continue
        return level



def generate_integer(level):


    if level == 1:
        n = 0
        c = 0
        while n < 10:
            (x,y) = random.randint(0,9), random.randint(0,9)
            w = 0
            answer = x + y
            while True:
                try:
                    guess = int(input(f"{x} + {y} = "))
                except ValueError:
                    w += 1
                    if w in range(0,3):
                        print("EEE")
                        continue
                    elif w == 3:
                        print(f"{x} + {y} = {answer}")
                        n += 1
                        break
                if guess == answer:
                    c += 1
                    n += 1
                    break
                elif guess != answer:
                    w += 1
                    if w in range(0,3):
                        print("EEE")
                        continue
                    elif w == 3:
                        print(f"{x} + {y} = {answer}")
                        n += 1
                        break
        if n == 10:
            print(f"Score: {c}")


    if level == 2:
        n = 0
        c = 0
        while n < 10:
            (x,y) = random.randint(10,99), random.randint(10,99)
            w = 0
            answer = x + y
            while True:
                try:
                    guess = int(input(f"{x} + {y} = "))
                except ValueError:
                    w += 1
                    if w in range(0,3):
                        print("EEE")
                        continue
                    elif w == 3:
                        print(f"{x} + {y} = {answer}")
                        n += 1
                        break
                if guess == answer:
                    c += 1
                    n += 1
                    break
                elif guess != answer:
                    w += 1
                    if w in range(0,3):
                        print("EEE")
                        continue
                    elif w == 3:
                        print(f"{x} + {y} = {answer}")
                        n += 1
                        break
        if n == 10:
            print(f"Score: {c}")


    if level == 3:
        n = 0
        c = 0
        while n < 10:
            (x,y) = random.randint(100,999), random.randint(100,999)
            w = 0
            answer = x + y
            while True:
                try:
                    guess = int(input(f"{x} + {y} = "))
                except ValueError:
                    w += 1
                    if w in range(0,3):
                        print("EEE")
                        continue
                    elif w == 3:
                        print(f"{x} + {y} = {answer}")
                        n += 1
                        break
                if guess == answer:
                    c += 1
                    n += 1
                    break
                elif guess != answer:
                    w += 1
                    if w in range(0,3):
                        print("EEE")
                        continue
                    elif w == 3:
                        print(f"{x} + {y} = {answer}")
                        n += 1
                        break
        if n == 10:
            print(f"Score: {c}")
            



if __name__ == "__main__":
    main()

#Updated Version with no errors!

import random


def main():


    n = 0
    c = 0
    level = get_level()
    while n < 10:
        x = generate_integer(level)
        y = generate_integer(level)
        w = 0
        answer = x + y
        while True:
            try:
                guess = int(input(f"{x} + {y} = "))
            except ValueError:
                w += 1
                if w in range(0,3):
                    print("EEE")
                    continue
                elif w == 3:
                    print(f"{x} + {y} = {answer}")
                    n += 1
                    break
            if guess == answer:
                c += 1
                n += 1
                break
            elif guess != answer:
                w += 1
                if w in range(0,3):
                    print("EEE")
                    continue
                elif w == 3:
                    print(f"{x} + {y} = {answer}")
                    n += 1
                    break
    if n == 10:
        print(f"Score: {c}")




def get_level():
    levels = [1, 2, 3]
    while True:
        try:
            level = int(input("Level: "))
        except ValueError:
            continue
        if level not in levels:
            continue
        return level



def generate_integer(level):


    if level == 1:
        return(random.randint(0,9))




    if level == 2:
        return(random.randint(10,99))




    if level == 3:
        return(random.randint(100,999))
    



if __name__ == "__main__":
    main()

https://preview.redd.it/ibw9mh60u12h1.png?width=1792&format=png&auto=webp&s=08068ccc73aea279b799b3347d8facc06938cbd5

reddit.com
u/StrawberryField4 — 3 days ago
▲ 12 r/cs50

FINALLY FINISHED MARIO (less confident)

This shit took me 2 days,

Genuinely some of the worst days of my life.

Mario is diabolical.

Anyways,

Ill Make the code a bit better designed.

Before submitting it.

Since I mightve made the WORST designed code in history.

Ill try finishing credit today as well.

And like finishing The first Like half an hour or so of the 2nd weeks lecture.

Then ill sleep.

Im trying to finish CS50 before my birthday,

Which is August 30th

Luckily nearly all my days are free since I finished school.

reddit.com
u/EngixoRain — 3 days ago
▲ 177 r/cs50

I did it!

i turned 14 this year, and oh lord this was quite a ride!

couldn’t finish last year, got forwarded this year.

(Tideman certified (: )

u/Ok_Gazelle1629 — 4 days ago
▲ 3 r/cs50

Mario-More

The problem seems to be very similar to the less confident one in which we have to print spaces first n-i times and then hashes i times but what about the part after that

The space between both triangle is consistent

So we'll have to print two spaces in between and then again the same triangle so I'm assuming in the outer loop we'll have to write code (loop) 4 times for the hashes and one loop for spaces that remains consistent

Am I on the right path? And if then won't the code be too long?? Is there any better way!?

reddit.com
u/Asleep-Weakness6271 — 3 days ago
▲ 11 r/cs50

29 years old… I want to try again

Another post asking for tips as a beginner. I’m so sorry… haha. I have no background in CS other than when I gave it a try maybe 8 years ago in community college but I was not in a place where I was focused enough. The teacher also just didn’t mesh well with me. Anyway, I now am a stay at home mom, she’s going to be 4 later this year and I keep coming back to this want to try programming again, keeps creeping up in my mind for the past 2 years.

Has anyone in here taken this course specifically while parenting? Am I in over my head? Is there anything I should do to prepare? My ultimate goal as far as what I’d want my job/role to be is still unclear, I feel taking CS50P first and then taking CS50 or CS50x might click with me better than the other way around. I’m someone who thrives in a trade setting as far as learning, so that’s a big reason why I feel learning Python first can help me kickstart. If that makes sense? Because it’s focusing on strictly just a language and I’m not being bombarded with the whole concept of comp sci, software engineering…

I just want to make sure I’m taking the proper courses to set myself up to be versatile. I am open to going back to school but I’d like to get myself into the programming realm first before committing to school… in the “realm” meaning learning it and seeing if it’s something I can see myself committing to proper school wise. But I’d love tips on how it can be done without a degree.

reddit.com
u/dudeidk1316 — 3 days ago
▲ 1 r/cs50

DP finally stopped feeling like black magic

Okay so I've been putting off dynamic programming for way too long. Every time it showed up I'd just pray it wasn't on the exam and move on.

Tried reading through it multiple times, watched stuff, none of it really landed. I think the problem was I was trying to memorize solutions instead of actually understanding what's happening under the hood.

What changed for me recently was finding a resource that actually showed a repeatable process like not "here's how to solve coin change" but more "here's how you'd think through ANY problem like this." Made me realize I wasn't bad at DP, I just never had a framework going in.

Still not gonna claim I can solve hard LeetCode problems in my sleep LOL, but medium-level stuff feels way more approachable now than it did two weeks ago.

Anyone else here go through that same wall with it? Curious if people found pset 6 / the recursion heavy stuff clicked at a certain point or if it was gradual.

reddit.com
u/Sea-Possession5267 — 4 days ago
▲ 4 r/cs50

How CS50?

Starting my cs50 journey from today. I have few queries regarding the course

  1. WHY CS50?
  2. What order should i start with, heard I should start with cs50 python then move on to cs50x if i'm a beginner, is that a thing?
  3. Do i need to know any basics before starting the course?
  4. How much time i should invest at minimum in a day, keeping in mind i have nothing else important to do no school no jobs nothig.
  5. How long would the course long at that pace?
  6. What other cs related things should I do in parallel to Cs50?
  7. Most important, is it still RELEVANT like its been out for years?
reddit.com
u/Ok_Lemon9377 — 4 days ago
▲ 3 r/cs50

How to think when solving a problem?

I watched/practised lecture videos(with hands on coding), section video and practice problems too.

The issue is that I am unable to see anything, let me explain, I feel blinded if anything outside the scope of lecture comes. I don't know if its called computational thinking or problem solving or logical thinking or all of the above but i just am nothing structurally as I should when I approach a problem.

I also think I am operating from memory as I find it difficult to understand technical language and coding jargon.

And I was able to understand the left aligned mario problem from section video but man oh man I'm stone cold stuck in pset mario problem right aligned pyramid.

I'm really frustrated and hating myself at this point.

reddit.com
u/axoqocal29 — 4 days ago
▲ 0 r/cs50

ADHD CS50 Prompt

> I strictly ask Chatgpt to never give me direct solutions.

I somehow finished week 1 - C - youtube lecture and section video too.

Did some hands on practice as well in parallel.

The frustating part is that cs50 doesnt teach you about the aspects of C, they're teaching programming.

So I am not aware that we can do arithmetic operations inside For loop.

I'm unable to think through Mario Problem right aligned even tho Left Aligned was clear to me.

I was wondering if you guys have any good prompts I can use in chatgpt to make me understand because normally I don't understand what those technical explanations mean. I generally comprehend better through :

- guided discovery

- step by step concept building

- mental models

- concise question driven explanations

But I get stuck despite that.

Does anyone has any suggestions? Or prompts I can use to help me through this?

reddit.com
u/axoqocal29 — 4 days ago
▲ 7 r/cs50+1 crossposts

From Signals to AI: How Angular Quietly Became Cool Again (v16 to v21)

I will be honest there was a stretch where Angular felt like it was losing the plot. While React is winning hearts with their simplicity and Claude (Claude AI responses are in react.), Angular was still making you set up NgModules just to sneeze. It felt heavy. Ceremonial. Like framework bureaucracy.

Then something shifted.

Starting around v16, the Angular team stopped patching the old machine and started building something new underneath it. Quietly, consistently, version by version they rewired the whole thing. And now with v21 dropping in May 2026, I think it's finally time to say it out loud: Angular is genuinely exciting again.

Here's how we got here.

v16 & v17 —> The Wake-Up Call

Angular 16 was the first sign something was different. Signals landed in developer preview a lightweight reactivity primitive that had nothing to do with RxJS observables or zone.js magic. Just clean, trackable state. It was not flashy, but developers who paid attention knew what it meant.

v17 was where things got loud. They redesigned the docs, refreshed the brand, and more importantly, gave us a new control flow syntax u/if, u/for and u/switch that actually looked like code instead of XML markup accidents. *ngIf always felt like a workaround. u/if feels intentional.

They also shipped u/defer for lazy loading components, which I would describe as the best quality of life improvement Angular has had in years. And swapping Webpack for Vite + esbuild cut build times by something like 67%. That alone changed how the framework felt to work with day to day.

v18 & v19 —> Killing zone.js (Slowly, Carefully)

Zone.js has always been Angular's secret weapon and its dirty secret at the same time. It is how Angular knew when to check for changes  but it iss also a monkey patching library that wraps every async operation in the browser. Not exactly elegant.

v18 introduced experimental zoneless change detection. The idea if your app runs entirely on Signals, Angular can skip zone.js altogether and only update the DOM when a signal says something changed. Faster, leaner, more predictable.

v19 made standalone components the default (finally), and added linkedSignal and the resource() API which, if you've ever tried to manage async loading states with RxJS, will feel like a revelation. It handles the loading/error/data cycle for you in a signal native way. It is the kind of thing that makes you wonder why it took so long, then realize the groundwork had to be laid first.

v20 —>Stabilization (The Unglamorous but Necessary One)

v20 does not have a flashy headline feature. What it has is stability and that actually matters. The zoneless APIs went stable. effect(), linkedSignal, the whole reactive core production ready. You could finally build a greenfield app without nervously checking whether that API was still experimental.

They also tightened security: automated XSS/CSRF protections, stricter Content Security Policy enforcement. And dynamic component creation got significantly less painful. No more wrestling with ViewContainerRef for basic runtime use cases.

v21 —> Where It Gets Interesting

Angular 21 is the first version where I feel like the team is going on offense rather than playing catch up.

Signal Forms  have been the one area where Angular reactivity story fell apart. ReactiveForms work, but they don't feel reactive in the modern sense. Signal Forms are a ground-up rethink: signal-based, zoneless compatible, and built around validation patterns that don't require you to think four layers deep. It's still early, but the direction is right.

Angular Aria Package Accessibility primitives built directly into the framework. Not a third-party bolt-on, not a style guide recommendation actual framework-level tooling for building accessible components. This is the kind of thing that matters enormously for enterprise teams who have compliance requirements and not enough time.

MCP Server Integration This one's forward looking. Angular 21 ships with Model Context Protocol server tools, which means AI coding assistants can actually understand your Angular project structure and generate correct, idiomatic code. Whether or not you're bullish on AI tooling, the fact that Angular is investing here signals (pun intended) where developer workflows are heading.

The Honest Summary

Compare an Angular 15 codebase to an Angular 21 codebase and they look like different frameworks. The NgModules are gone. The *ngIf soup is gone. Zone.js is optional. The build tool is fast. The reactivity model is coherent.

None of this happened overnight, and none of it happened by accident. It was a deliberate, multi-year migration and the Angular team mostly pulled it off without breaking existing codebases, which deserves more credit than it gets.

If you wrote Angular off a few years ago, I get it. The timing probably made sense then. But if you haven't looked at it lately, it's worth a fresh look. The framework that made you set up a module to register a pipe is not the one you'd be using today.

reddit.com
u/thejspythonguy — 6 days ago