r/cs50 • • 45m ago

CS50x Hearty Congratulations, Buddy. You have been an excellent role model for everyone including the ever-doubting # Me too.

2 Upvotes

Well done; keep it up!


r/cs50 • • 8m ago

CS50x Stuck after Week 1 due to a hectic schedule: How do you guys find time for CS50 (and count your days)?

1 Upvotes

Guys, I just did the psets and lectures 0 and 1 like 2 months ago. Then I got a lot of work and an unstructured timetable. I want to finish it, but I cannot manage time for it.

How do you manage your time to do CS50 if you already have a lot of pressure and blocked time? And how would you count your days on CS50? From the day you started, or the number of days you've given to CS50?


r/cs50 • • 2d ago

tideman I just solved Tideman

28 Upvotes

I just solved Tideman. It's been 6 days. I thought lock_pairs would be the worst because that's where I got really stuck last time. This time it was actually print_winner that had me pulling my hair out.

I took this class for the first time back in 2020 or so. Tideman was challenging back then and I gave up on it and then didn't want to finish the class because I felt like I failed.

This time I didn't give up. The two print_winner tests were red over and over and over and it felt like I would never solve it. I felt so frustrated and hopeless. Then, suddenly, all it took was one idea to change both of those red tests to green, just like that, after hours and days of trying with nothing happening.

I'd thought something was broken because I couldn't get it to work when it seemed like it should work. I was going through an emotional journey.

If you're stuck on it, keep working at it, keep trying new things, keep tweaking. Keep it in mind, play with it, and work at it a little every day at least. Don't be afraid to delete and try again. (Save your work first just in case you want to reference it later.) Just don't give up. If I can do it, you can do it.

I feel like I learned so much throughout these 6 days, learning that could only happen through painful and frustrating experience. I've been feeling grateful for that throughout the process and trying to hold it as motivation to keep going. Don't give up. The solid green at the end makes it all worth it.

Thank you to the people in the sub who encourage others through Tideman and/or other problems. Your encouragement in general has really helped me through when I wanted to give up.


r/cs50 • • 1d ago

CS50x I have been accepted into Harvard's Programming With Python Course! #programming

Post image
0 Upvotes

I DID IT GUYS!


r/cs50 • • 2d ago

CS50-Technology Stupid

Thumbnail reddit.com
0 Upvotes

r/cs50 • • 3d ago

CS50x What can i do/build after completing CS50?

15 Upvotes

I want to build projects, and move ahead from vibecoding. I've started cs50 but it's hard to continue cause i feel like it's basics (so far) so it won't really help me in building actual programs.

Could you give examples of if i do CS50X + (CS50P) what is the kind of knowledge I'll be gaining that allows me to build etc etc? I've read through the syllabus but it dosen't really guide on this sort of stuff.


r/cs50 • • 4d ago

CS50-Law Great Journey CS50L, Thank you CS50 Community

Post image
51 Upvotes

Thank you DLloyd Sir, Prof David Malan, Brenda curiouskiwi, pensivepanda, and everyone in the CS50 community.
Godspeed , God Bless. 🙏🏻

I watched every single CS50L Lecture video and read all the youtube comments.
(goes without saying but yes of course you ought to watch the Lecture videos).
required effort to put in is High Effort.

i took 11 weeks to finish CS50L. It was longer than i initially anticipated. The course is also way much more difficult than i thought it would be initially.
Initially i was aiming to complete within 4-5 weeks ( xD ), however wasn't possible. Perhaps finishing in 8 weeks is possible, if i had less distractions and other work and more discipline.
i would opine that, and my advice, is that most importantly, would be to study and learn well , ponder deeply. Learning fast could be good, but do not rush, and especially do not compromise on learning.

Very fascinating learning journey (!) .
Fascinating and interesting topics, and of course taught from the greatest and goatest teachers, DLloyd and David Malan.
The last lecture is mindblowing and so cool !.

i feel that the learning experience feels very fresh, educational and insightful, to learn about point of views from a Law perspective and direction . It allows us to ponder about topics that we might miss and/or not usually think about.
Even though some topics may not be so technical in CS, but even for general knowledge domain and law domain, there are many interesting aspects to ponder about. 👍🏻

i highly recommend perusing Ken Thompson's "Reflections on Trusting Trust" .
Be Amazed ! .

All the best everyone 🙏🏻


r/cs50 • • 3d ago

CS50 Python Unable to submit my program

Post image
4 Upvotes

Is anyone else facing this issue?


r/cs50 • • 3d ago

CS50x CS50.dev codespace stuck on "Setting up your codespace" – tried deleting and recreating, still no luck

Post image
5 Upvotes

Hi everyone,

I'm having trouble getting my CS50.dev terminal to open. My codespace has been stuck on the "Setting up your codespace" message for a very long time and never finishes loading.

Here's what I've already tried:

- Deleted the stuck codespace and created a new one (as suggested by cs50.ai)

- Cleared my browsing history and cache

- Switched from Microsoft Edge to Google Chrome

- Confirmed my internet connection is stable

- Checked the GitHub status page and the CS50 status page, and both show all systems operational

The new codespace shows the exact same message in both browsers and never gets to the terminal.

Has anyone run into this before? Is there anything else I can try, such as changing codespace settings or something specific to the CS50 setup?

Any help would be really appreciated. Thanks in advance!


r/cs50 • • 4d ago

CS50 Python Problems in Week 2

3 Upvotes

How can I check if a letter appears after a number in plates.py without running into an index error?


r/cs50 • • 5d ago

CS50 Python CS students and software engineers: How do you balance university coursework with learning real-world CS skills independently?

Thumbnail reddit.com
0 Upvotes

r/cs50 • • 5d ago

CS50x Claude Code Help For the Final Project

1 Upvotes

I'm currently in the final stage for the CS50 final project and about to begin writing the code. I have a simple question. Are we allowed to employ Claude Code where we are in control and understand what is going on?

I was considering using it to have suggestions on code and learning faster, and from time to time implementing some of its code. In such a work scenario, the essence of the code would be mine, and I would write much of the code. The reason I find Claude Code really helpful (from prior experience) is as follows:
a) because it directly can view my codebase and answer any questions I have accordingly
b) because it can suggest some code when I really feel stuck.

This feels appropriate with the CS50 Academic Honesty, but a prior post made me tentative and I want to make sure. Best :)


r/cs50 • • 6d ago

CS50 Python Check50, uhm what?

3 Upvotes
months = [
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December"
]


def split(var):
    if "/" in var:
        splitted = var.split("/")
        if splitted[0].isdecimal() == False:
            #print("error in splitting")
            return
    elif "," in mdy_format:
        splitted = var.split(" ")


    try:
        return splitted
    except UnboundLocalError:
        #print("unboundlocalerror")
        return


def checkvalues(checkval):


    day, year = checkval[1], checkval[2]
    #print(day)


    if checkval[0].isdigit():
        month = int(checkval[0])
    else:
        try:
            month = months.index(checkval[0]) + 1


        except ValueError:
            #print("valueerror")
            return
    if month > 12:
        return


    day = day.replace(",","")
    #print(day)
    try:
            day = int(day)
            year = int(year)
    except ValueError:
            return



    if day > 31:
        #print("moth longer error")
        return


    #print(f"{day:02}")
    return f"{year}-{month:02}-{day:02}"



while True:
    mdy_format = input("Date: ")



    mdy_splitted = split(mdy_format)


    #print(mdy_format)
    #print(mdy_splitted)
    #print(len(mdy_splitted))


    #useless comment
    #another useless comment


    if not mdy_splitted or len(mdy_splitted) != 3 or checkvalues(mdy_splitted) is None:
        #print("error here")
        continue


    print(checkvalues(mdy_splitted))
    break

why does it return an error? After doing acheck it seems to return the correct answer.

Code above (ignore the comments)


r/cs50 • • 6d ago

codespace Scrabble Homework Spoiler

4 Upvotes

I completed the scrabble homework after messing around with loops and submitted it to get full points in design and style, however one of my bugs wasn't solved in a sustainable way. I'm having trouble figuring out why my indexed array for 'D', 'd', 'G', and 'g' assign 3 points instead of 2. My bandaid fix was to assign those values 1 point so that the program can correctly assign them 2 points. Can anyone help me work through this?

char LetterValue[7][20] = {
    {'A', 'a', 'E', 'e', 'I', 'i', 'L', 'l', 'N', 'n', 'O', 'o', 'R', 'r', 'S', 's', 'T', 't', 'U', 'u'},
    {'D', 'd', 'G', 'g'},
    {'B', 'b', 'C', 'c', 'M', 'm', 'P', 'p'},
    {'F', 'f', 'H', 'h', 'V', 'v', 'W', 'w', 'Y', 'y'},
    {'K', 'k'},
    {'J', 'j', 'X', 'x'},
    {'Q', 'q', 'Z', 'z'},
};


int ScoreValue[7] = {1, 2, 3, 4, 5, 8, 10};


const int N = 2;
void compareWordValues(int Q, int scores[]);
int Addition(string words);


int main(int argc, string argv[])
{
    // declare an array of strings so player can submit two words that share a variable
    string words[N];
    // declare an array of the scores created, each iteration has to be stored somewhere so I can
    // compare values later
    int scores[N];
    // use loop to ask player to submit 2 words
    for (int i = 0, m = 0; i < N; i++, m++)
    {
        words[i] = get_string("player%i: ", i + 1);
        // submit both words one at a time into this array
        scores[m] = Addition(words[i]);
    }
    compareWordValues(N, scores);
}


// detrermine the value of each letter in the submitted word
int Addition(string words)
{
    int value = 0;
    // loop the string as an array of chars to index each one individually
    for (int i = 0, n = strlen(words); i < n; i++)
    {
        // loop over all the letter/score value possibilities
        for (int j = 0; j < 7; j++)
        {
            // simply for readability within the loops I give the current char a variable name
            char currentLetter = words[i];
            int letterValuesLength = strlen(LetterValue[j]);
            // k represents all the char in row j because they vary
            for (int k = 0; k < letterValuesLength; k++)
            {
                if (currentLetter == LetterValue[j][k])
                {
                    // both the arrays lettervalue and scorevalue share the same number of rows
                    value += ScoreValue[j];
                }
            }
        }
    }
    printf("value = %i\n", value);
    // pass this value out of the function and into my scores array
    return value;
}


void compareWordValues(int Q, int scores[])
{
    if (scores[0] > scores[1])
    {
        printf("Player 1 wins!");
    }
    else if (scores[0] < scores[1])
    {
        printf("Player 2 wins!");
    }
    else
    {
        printf("tie!");
    }
}

r/cs50 • • 7d ago

CS50 AI Problem with Submitting the Final Project

Post image
5 Upvotes

Hello! Im posting this to find advice what i can do to this matter. I finished my final project in SQL course and is ready to submit. An error says that it cant connect to Github. I do have a good internet and I didnt encounter this problem in my Problem sets. Please tell me what i can do.

Thanks!


r/cs50 • • 7d ago

codespace Screen got stuck while setting up

Post image
7 Upvotes

It's been showing this message for a whole hour now. I have tried restarting my device, changing the browser, going to incognito mode, but nothing works. I have my whole week 0 work stored there, and I was just about to do my first week 1 project when this happened.

What should I do?!


r/cs50 • • 8d ago

CS50x Thank you CS50!

44 Upvotes

Hi everyone! I finished CS50x and just wanted to say thank you, and a special thank you to David and Brian. This course gave me the confidence to start building things for real. I'm now continuing with CS50P and CS50W and really looking forward to it.

If you're thinking about your first real project after CS50, my advice is to pick something you actually need yourself. It keeps you going when things get hard. Mine was an Android app for my own home server. What was your first project after CS50, and what did you learn from it?


r/cs50 • • 10d ago

CS50x Why is my codespace not loading??

Post image
7 Upvotes

r/cs50 • • 11d ago

PHP-ocalypse? | The CS50 Show with David J. Malan | Season 1, Episode 2

Thumbnail
youtube.com
65 Upvotes

In today's episode, a worldwide scramble to update servers, cyberattacks on … freezers, and a trip to San Francisco.

This is the CS50 Show, wherein we not only talk about current events in technology but also explain them to you.


r/cs50 • • 10d ago

CS50x Week 1, Credit, please help I'm going crazy. Spoiler

7 Upvotes

So I'm stuck on credit for a while now probably 6-ish hours. I got no clue, AI isn't helping and I cant find anything, is it something so stupidly simple that I'm gonna hate myself even more..... I'm so close and yet so far, can someone guide me please.

Its a bit messy but ill go through it eventually and clean it up after it actually works. also the final_check() function is incomplete I know, but its not even calculating it right for it to check it properly so i didnt finish it yet.

#include <cs50.h>
#include <stdio.h>


void final_check(int, long, long);
int split_and_add_digits(int);
int get_input_length(long);
int main(void)
{
    long credit_number; // Store outside so i can use it.


    do
    {
        credit_number = get_long("Enter Number: ");
    }
    while (credit_number < 1);


    long modulo = 10; // Set to 10 cuz i cant divide by 0 lmao.
    int odd_digits_sum = 0;
    int even_digits_sum = 0;


    for (int i = get_input_length(credit_number); i > 0; i--)
    {
        // Move down each digit of the input.
        long single_digit = credit_number % modulo;



        // Find every odd.
        if (i % 2 == 1)
        {
            // Check when this number is doubled it is 2 digits long or not.
            if (get_input_length(single_digit / (modulo / 10) * 2) == 1)
            {
                // Function returns the inputs digits added together.
                odd_digits_sum += split_and_add_digits(single_digit / (modulo / 10) * 2);
            }
            else // if not then just add it normally
            {
                odd_digits_sum += single_digit / ((modulo / 10) * 2);
            }
        }
        else // Find every even and add it.
        {
            even_digits_sum += single_digit / (modulo / 10);
        }
        modulo *= 10;
    }


    int total = odd_digits_sum + even_digits_sum;
    final_check(total, credit_number, modulo);


}


// Take an input that has 2 digits, split and add them, return result.
int split_and_add_digits(int input)
{
    int first_digit = input / 10;
    int second_digit = input % 10;


    return first_digit + second_digit;
}


// Take an input and divide by 10. Return the amount of times it divides.
int get_input_length(long input)
{
    int input_length = 0;
    while (input > 0)
    {
        input /= 10;
        input_length += 1;
    }
    return input_length;
}


// Final checks
void final_check(int total, long credit_number, long modulo)
{
    int credit_length = get_input_length(credit_number); // Get the length of users input.


    int checksum = total % 10; // Get the last digit of total.
    modulo = modulo / 10; // Move the modulo back a space because the main loop finishes by adding one more.
    long shift_digits = credit_number % modulo; // Shift digits from left to right.
    int first_two_digits = shift_digits / (modulo / 100); // Get first two digits.
    int first_digit = shift_digits / (modulo / 10);


    //printf("Checksum: %i\n", checksum);
    //printf("Credit Length: %i\n", credit_length);



    if (!checksum)
    {
        if (credit_length == 13 || credit_length == 16) // Check for visa.
        {
            if (first_two_digits == 51 || first_two_digits == 52 || first_two_digits == 53 || first_two_digits == 54 || first_two_digits == 55)
            {
                printf("MASTERCARD\n");
            }
            else if (first_digit == 4)
            {
                printf("VISA\n");
            }
        }
    }
    else
    {
        printf("INVALID\n");
    }
}

r/cs50 • • 11d ago

CS50x CS50 problem set 0 from 2 years ago being reused.

Thumbnail scratch.mit.edu
0 Upvotes

Made this when I was 12 now 14 and giving CS50 another chance I plan on just using this for the first problem set what do you guys think?

(you can probably tell by the humor lol)


r/cs50 • • 11d ago

CS50x CS50 and CSS at the same time?

0 Upvotes

Hello,

Is it advisable to learn CS50x and CSS at the same time?

Thank you.


r/cs50 • • 12d ago

CS50x Grading

4 Upvotes

Hi!

I am completing the Introduction course and would like to get the certificate in the end. However, when writing the programs, I like to keep some notes in there, just for me to better understand and return back to. Will this be a problem when getting graded? Or is the grading very much just a : Program is there and program is correct process?

Thank you for tips and insights!


r/cs50 • • 12d ago

CS50x First year BTech Biotechnology student interested in bioinformatics. Looking for guidance on learning Python, programming and building a career.

6 Upvotes

hi everyone, I'm a first-year BTech biotechnology student at a relatively lesser-known college. I'm interested in bioinformatics and computational biology, and I'd really appreciate some guidance from people who are already working or studying in this field. I've recently started learning Python because I want to build programming skills alongside my biotechnology degree. Here's what I've been doing so far: I'm following Corey Schafer's Python beginner tutorial series. Instead of just watching the videos, I'm trying to turn the concepts from each video into small practical projects and problems, inspired by Rosalind bioinformatics exercises. I'm also following the Bioinformatics in Python playlist by Rebel Science to understand how Python can be applied to biological problems. I've started developing small Python projects related to DNA sequence analysis, nucleotide counting, GC content, melting temperature calculations, codon translation, gene expression analysis and FASTA file parsing. I'm using VS Code for programming. I'm still learning how to use the editor, its shortcuts, extensions, and other features. I haven't started using GitHub yet. I don't know how to properly upload, organize, or maintain my projects, but I want to learn how to build a portfolio. I'm also considering taking Harvard's free CS50 Python course to strengthen my programming fundamentals. I'd really appreciate advice on a few questions: Is my current approach to learning Python and bioinformatics a good starting point, or would you recommend a different learning path? Should I complete Corey Schafer's tutorials first and then move to CS50P, or should I follow both? At what stage should I start learning Git and GitHub, and how important are they for someone entering bioinformatics? What programming languages and technical skills should I prioritize besides Python? Should I start learning R, SQL, Linux, and statistics? What kind of projects should I build to develop a strong bioinformatics portfolio and eventually become eligible for research opportunities and internships? As a first-year biotechnology student, what should I focus on over the next two to three years to become competitive for bioinformatics internships and future opportunities? And here's one extra question, since I'm asking in the CS50 community as well: since I'm a first-year biotechnology student interested in bioinformatics, would completing CS50x and CS50P, followed by SQL, R, and AI give me a good foundation? Or would you recommend a different order? In the meantime, I'm attaching a couple of screenshots of my projects, so you can see where I'm starting from. Thanks for any advice.