r/cs50 • • Sep 30 '24

IDE Someone tell me why this not works

Post image
1 Upvotes

Leetcode:find the k th character in a game


r/cs50 • • May 12 '22

Scratch Amber Heard VS Captain Jack Sparrow Game Ver 2. Arrow Keys movement [Scratch Week 1 Practice]

2 Upvotes

r/cs50 • • Jun 06 '25

CS50x Cheating

0 Upvotes

Im just starting the course and doing intro stuff and thought about it. Can't people just look up the solution paste it and turn it in? Does it just run on the Honesty system? Also is it worth it? It's so openly available im not sure how much of an accomplishment that is. The lessons are literally on youtube


r/cs50 • • Mar 11 '14

New to CS50, thought I'd say hi and introduce my programming team.

Thumbnail
imgur.com
10 Upvotes

r/cs50 • • Jan 01 '26

CS50x How is CS50 adapting to the world of AI and assisted coding?

2 Upvotes

With tools like ChatGPT, Copilot, and other AI-assisted coding becoming common, I’m curious how CS50 is evolving to keep the course relevant.

Is the curriculum changing to address AI-assisted problem solving, code review, or prompt engineering? Are there updated policies on using AI tools for assignments, and how does CS50 balance teaching fundamentals with the reality that many developers now code with assistance?

For people who’ve taken CS50 recently—or are currently enrolled—does the course still emphasize writing everything from scratch, or is there guidance on how to use AI responsibly as part of the learning process?

Interested to hear thoughts from students, alumni, or staff who’ve seen how the course is adapting.


r/cs50 • • Feb 04 '25

CS50x Is there a reason VSC (Visual studio code) is so primitive?

2 Upvotes

I'm not sure exactly how to put this. But I've been wanting to get back into programming after a loooooong hiatus, so i started doing CS50x in my own time. However when i first began learning all those years ago i learned in visual studio, and I'm SORELY missing things like a simple compile button.

Is there a reason VSC doesn't have such a simple feature and as a newbie is there some reason i should specifically stick to VSC as opposed to upgrading to a higher end IDE?

(Keep in mind I'm just in week one, perhaps these questions will be answered later?)


r/cs50 • • Jan 06 '23

breakout CS50 for a non-US person struggles

1 Upvotes

Hi all,

As the title suggests,, I'm not from the US but the UK instead. I understand CS50 is more aimed at the US education system but I'm struggling to wrap my head around even the first few psets.

For example, the first two involved the US currency system where you're provided with an amount and thwn you have to calculate how much of each denomination goes into it (something about greedy algorithms), however I have no I dea how each goes into what and how to convert it.

There's another which I struggled with which involved service tax (we don't have that here) and tips (again, not a common thing here) and google didn't really help either.

I think what I'm trying to ask is, is there more material involving the US way of life or is it more generic?

Also, how did all of you non-US peeps cope with it?

Cheers!


r/cs50 • • Feb 17 '24

IDE Anyone who starts cs50 and is having problems come here.

0 Upvotes

This is for people who are trying to start but are lost at just getting to part 0

so most obvious make sure to use the videos as guide to your studies.

to get the coding to work its pretty simple https://cs50.dev thats the website to bring you straight to your own cs50 directory, dont try to do it alone on vscode its a pain to bring in the libary when you can just sign in to that link and have everything ready to go.

once your logged in you should be equipped with the necessary libraries and what i would do is in the mode you are in after logging in is to make a folder to store this files on.

in the folder make the first c the class instucts you to do and head to terminal then console and type ls, this should show what folder the therminal is currently on what you want it to do is go into the folder you created to read files in that folder. Do this cd "folder name" this will bring the console into where your c files are and you can start coding as everything should go smoothly.


r/cs50 • • Mar 23 '24

CS50 Python Intro to python beginner here, hints for assignments are absolutely useless

0 Upvotes

I am well aware what I am about to say may be seen as a hot take coming from a beginner who doesn't ave much knowledge in python, but this may be a viewpoint of others in the course.

I am currently on the"tip calculator" assignment but have been stuck on the last couple assignments and have needed help with them, the "hints" tab does literally nothing to help if I'm being honest.

This is a "hint" in my current assignment.

"Recall that input returns a str"

Like, no shit? I've been coding for less than two weeks and using input commands on the past couple assignments, so for this is be a "hint" feels like a slap in the face. I feel like I've just been thrown to the wolves and basically rely on 3rd party help to truly understand the thought process behind some of these assignments. I'm having to learn functions that weren't taught to me in the lecture. With CS50 insists you go through the encyclopedia that is Python Documentation which is incredibly inefficient especially for a newbie, because even if you find the new function, you're still confused on how to use it.

Seeing someone else solve the problem and show how to do the assignments has been incredibly helpful for me, but ultimately defeats the purpose of the assignments. I don't like using 3rd party sites as it may be on the fringe of potential plagiarism, but when the "hint" system is this useless and open-ended to a beginner, I can surely see why others will check for answers.

With A.I being so widely used nowadays, I would love to see a potential A.I hint based system, where you submit your unfinished work on cs50, and the A.I could give you a potential clue on what you are doing wrong or what you are missing in your code. This lowers the barrier to entry and may make learning programming more of a guided experience, than the current "find your own path in the dark" that it feels like for many.


r/cs50 • • May 28 '26

cs50-web Guys, I was thinking if I start learning front-end development now, and with the right training, I should be able to start looking for a junior developer job in 6-8 months, right?

0 Upvotes

Some people have told me that I can join certain companies right now as an intern or trainee, and they’ll teach me everything from scratch. I’m not sure how true that is, so I think it’s better to learn everything on my own first and then look for a junior-level job. What do you think about that? Also, could you suggest a good learning plan? Maybe you know of a good course?


r/cs50 • • Mar 11 '25

CS50x Hot take: Would CS50 be relevant 2 years from now?

5 Upvotes

Just watched a recent discussion on YT of Y combinator, folks discussing how vibe coding is becoming a real thing and over 90% of the technical founders are now writing code through cursor etc. Thoughts?

EDIT: The case I’ve shared above is to engage in constructive discourse based on the fact that this discussion on vibe coding is popping up on various forums. This by no means is my opinion 😀


r/cs50 • • Oct 22 '23

sentimental I'm not watching the video!!!

Post image
0 Upvotes

Bruh, I'm trying to make this tideman thing and the walkthrough man is just looking at me from the corner of the screen like don't you want to watch this intuitive video to help you better understand the problem? >:)


r/cs50 • • May 25 '25

CS50 Python WHAT IS POLYMORPHISM ? DIFFERENT POLYMORPHISM IN C++ AND PYTHON

0 Upvotes

You can describe all about OOP for me


r/cs50 • • Jul 16 '24

tideman tideman is STUPID Spoiler

0 Upvotes

ok, maybe stuipd is a bit agressive. sorry. i'm just really upset. this dumb duck keeps sending me in circles, giving me wrong suggestions completely, and pretending to empathize with me about my frustration, even though IT IS THE ONE causing my frustration.

on top of that, i find the problem set outline really doesn't give very much useful guidance. things such as whether or not i can use a stable sorting algorithm aren't addressed clearly (it is suggested, in my opinion, that you don't need a stable algo, but when i tried to use selection sort, it didn't work). So what the heck is with this stupid duck??? It has to be the worst implementation of an ai assistant i've ever seen. i show it my code, and it tells me I have a problem and makes a suggestion that isn't logical, so i reply to explain why it's suggestion doesn't make sense, and it replies with apologies and confirms i am correct. then it goes on to make another nonsensical suggestion, and the process repeats. what the heck is with it???

can anyone look at my code and please please please help me??? i am getting so pissed off here. i've gone through a couple of sorting algorithms. initially i was going to use selection sort, and the dumbass duck said that was a great idea, so i trodded through getting it working, only to have it fail check50. when i showed the duck, it told me that my implementation was correct but that selection sort isn't stable, so i should try something else. well why the hell did you say it was a great algorithm to use for this program??? then i tried another one, and couldn't get it to work and the duck sent me in circles for a few hours. then i tried using insertion sort, and i thought that I had it working right, but check50 still fails me!!! i don't get it!!!

i decided to add an extra field to the pairs struct, which is an int that contains the strength of the victory for that pair. i figured this made much more sense than calculating the strength of the victories later. the stupid duck told me this was acceptable, and check50 passes my add_pairs function. I'm going to paste my add_pairs code and my sort_pairs code. please help me before i just quit and give up. i'm really starting to wonder if CS is for me. I've loved computers all my life, and programming has always been a life long goal, but this is really feeling quite depressing and demoralizing. i really wish there were more real life people we could talk to and get help/advice from.

void add_pairs(void)
{
    // loops through preferences array to check for candidate pairs
    // where there is preference, and when found, add entry to the
    // pairs array, then increment the pairs_count variable
    int pair_strength;
    for (int i = 0; i < candidate_count - 1; i++)
    {
        for (int j = i + 1; j < candidate_count; j++)
        {
            pair_strength = preferences[i][j] - preferences[j][i];
            if (pair_strength != 0)
            {
                if (pair_strength > 0)
                {
                    pairs[pair_count].winner = i;
                    pairs[pair_count].loser = j;
                    pairs[pair_count].strength = pair_strength;
                }
                else if (pair_strength < 0)
                {
                    pairs[pair_count].winner = j;
                    pairs[pair_count].loser = i;
                    pairs[pair_count].strength = -pair_strength;
                }
                pair_count++;
            }
        }
    }
    return;
}



void sort_pairs(void)
{
    // TODO
    for (int i = 0; i < pair_count - 1; i++)
    {
        pair temp_pair = pairs[i];
        int j = i - 1;
        while (j >= 0 && pairs[j].strength < temp_pair.strength)
        {
            pairs[j + 1] = pairs[j];
            j = j - 1;
        }
        pairs[j + 1] = temp_pair;
    }
    return;
}

r/cs50 • • May 10 '26

CS50x should i do tideman or runoff

0 Upvotes

Hello everyone, I am 13 years old and currently on week 3. So far i have done the more "difficult" of each problem set (I did credit instead of cash, etc.). But now i am at Tideman. i spent a long long time trying it, but only finished the first function. I am now watching the runoff video. Should i sty with runoff now, or switch back to Tideman?


r/cs50 • • Jan 13 '22

breakout Why does David wear a mask for a front row audience of puppets?

24 Upvotes

He’s sweating the whole time too, it gets distracting at times tbh. I just don’t see the point. His airflow is restricted while he clearly seems passionate about the topic at hand.


r/cs50 • • May 05 '25

CS50x How can i start CS50x

0 Upvotes

how can i enroll


r/cs50 • • Mar 23 '25

CS50x I Went from Knowing Nothing About Programming to Building Projects—Here’s What Helped Me the Most!

0 Upvotes

A few months ago, I barely knew how to code. Now, I’m building my own projects, learning CS50, and improving my problem-solving skills every day. It hasn’t been easy, but here’s what worked for me:

  1. Consistent Practice: Even 30 minutes a day makes a huge difference.

  2. Building Small Projects: Instead of just following tutorials, I started creating things.

  3. Understanding, Not Memorizing: I focus on why something works rather than just copying code.

  4. Using GitHub: I was new to it, but version control has been a game-changer.

  5. Asking Questions: Whether on Reddit, forums, or with my teacher, I never hesitate to ask.

If you’re struggling to stay motivated or feel overwhelmed, I get it! What helped you the most when learning to code? Let’s share tips and make learning easier for everyone.


r/cs50 • • Jul 01 '24

homepage Discord ban

1 Upvotes

Can someone help me get unbanned as I was banned for being under aged but I had parental control and I was using my brothers account and I really need help for assignments please help me


r/cs50 • • May 16 '24

tideman So, I finished Tideman... very fast. I'd like to give some suggestions to the ones solving it.

0 Upvotes

Tideman... the hardest problem in the entire course of CS50x.

I tried to do it... and I could complete it at a relatively faster pace than others, but it was challenging nonetheless. Also, a very important note:

You can take as much time as you want, you can even solve Runoff (though I haven't looked at it till now). Only one thing: please DON'T think that some XYZ guy solving Tideman within 7 hours is implying that you need to do it too. Obviously not. Take your time...

This pset is challenging but it can even open an amateur coder's mind. I understood what Graphs (in CS) exactly are from this very pset.

Preliminaries

I want to say, understand structs very carefully if you have coded in Java and are learning C. For those who are getting to know about these algs recenty (applies to Python coders too), understand it thoroughly first. Also, if possible, write the algs which you are confused about. Like, try to use some website or stuff, or even ddb to understand how the alg works (NO DIRECT CODE), like certain analogies.

Anyway, the things that are hard in various algs are as follows:

  • Linear Search: That return false thing which David Sir said in the lecture.

  • Binary Search: Understanding how the high and low indexes are adjusted. The way I like to explain binary search (without using recursion) is using some thumb pins attached on a board like an array and keeping a rubberband stretched between the high and low indexes. That way, when you'll try to change the index, you'll just think to yourself, "I'm keeping the high/low index jussst beyond the middle position." Try it/visualize it for yourself.

  • Selection Sort: The exact thing we use when we did those ascending-descending order problems in the first grade... anyway... understanding why the inner loop starts from the next index is important. Also, people do forget to swap after everything, which shouldn't be forgotten.

  • Bubble Sort: Bubbble Sort can be done more efficiently by tweaking with the test condition in the inner loop... but we don't need to focus on that for now. Just remember that you need to insert the reverse of the condition you are trying to fulfill. For example, for sorting in ascending order, you need to check if the previous element is, in some way, shape, or form, greater than the next element.

  • Merge Sort: Ok, I am still confused regarding this one, but one way we can approach that is to understand how merging works. You need to write a program where two arrays are merged in ascending/descending order into one array. The two arrays need to be random. You can find examples for this problem on the internet, but please don't look at the solutions. You CAN USE your loops while merging the two arrays, but merging really doesn't require any other sorting algorithm, just two counters (a hint).

Before understanding Tideman, please have a strong grasp in any of the sorting algs. Understand why the conditional is there, because the conditions will be different for this problem. You can even solve the hardest sorts if you know what the conditionals do in your sorting alg.

Also, recursion is really worth learning independently. Solve some problems you are trying to solve using iteration. Try to check whether something is a prime number using recusion. Try to do anything you have solved/can solve using iteration.

Recursion is just mathematical induction (for those who know maths): it's just dominoes falling. You need to check what will happen when the first domino or the last domino will fall (base case), and ensure that if a domino m is falling, ensure that the domino m+1 is falling too (recusive case).

Please watch the shorts and section for this week, in case you don't understand anything. Check for the materials you don't understand.

Also, PLEASE do the additional practice problems of week 3. There's no check50 or submit50 for these problems, you can check the results for yourself. Even if you are a experienced programmer, I'd recommend taking these baby-steps before trying to attempt Tideman. See, even if you did Java or Python before and you feel like finding the max value or making a WHOLE MENU is tiring, these are very easy problems, which are important for solving the later ones. For example, I was thinking, "Why just take the value? Why not take the index?" Then when I was trying to solve the Plurality pset, I realized that they were trying to tell us that there can be multiple winners... anyway...

Tideman

So, you've completed Sort, Plurality and, possibly, even Runoff and all the other psets... and you're trying to attempt this.

  1. Open the walkthrough video/the pset page.

  2. For newcomers, write (about) all the variables and their functions “in brief”. Or just look at the distribution code or the pset page. These are very essential, and you’ll have to refer to them frequently.

  3. When the walkthrough video comes to the functions part, we’ll start focusing on THAT FUNCTION only. As David Sir said throughout the course till now, abstraction is the key. Like, think of only that part of the main method where a particular function has been implemented, how that part has been treated... Just don't think about the other functions you’ll have to do. JUST do that part and return accordingly. Write pseudocode like you’ve done throughout the course.

  4. If you want, you can reuse the codes you’ve written…

Let's talk about what we can do in the individual functions:

  • For the vote function, you will probably remember the discussion on linear search. Implement that, but do understand what are the uses of those parameters.

  • For the record_preferences function, I would recommend you to use a pen-and-paper to understand the situation, visually. Also, understand that you are trying to check who wins between two candidates, AND THEN determine the preference. Also, i over j.

  • For the add_pairs function, you will obviously have to run an inner loop and an outer loop for traversing through the array. One more thing: remember the technique you did in your previous functions.

  • For the sort_pairs function, you’ll be happy to hear that you can quite literally write abc a[i] = b, where b is a struct of abc. You won't need to write different variables like abc a[i].smile = b.smile and make your code longer (where smile is a variable in struct abc).

  • (Before attempting the lock_pairs function, read this thing I’ve got from the Discord server)

  • For the lock_pairs function, you are free to make any other recursive function you want in the code. Think of the parameters it will take. You’ll understand the parameters if you understand all the base cases. The return type will obviously be bool or int (you may take anything you want though). One thing to note though: search through the destination part thoroughly, using a loop in the recursive function. If necessary, you can write a recursive call in the loop too. Remember that base case is written first and then your main part of the code: the loop part. In this function, it's very important not to get overwhelmed. Recursion will do the teeny-tiny details for you if you write the base case properly. So, have that “leap of faith,” and search through and step into and through and step into and through and step into… you get the idea right?

  • By the way, how will you differentiate between what you’ve already traversed and what you have not traversed? After all, you only have a bool array with true and false as the only acceptable values. Make changes in the lock_pairs and in the recursive function accordingly. Also, lock_pairs function is in itself, also, not unimportant, as it also does some pretty eccentric stuff too.

  • For the print_winners function, atleast I would rather use statements like break and continue. Consult the Internet if these are confusing for you. Btw, labelled loops don't exist in C. I’m heavily disappointed. Alternatively, you can use variables declared outside the outer loop to note the index(es). Also, you’ll have to use a flag coupled with those two statements or those variables. “For this problem, we can assume that there is one source.” Therefore, as soon as you print your stuff, just wait no more. (This was just an efficiency rant btw, this function is actually easy if done without any help from this post; just spoiler-tagged it so that you don't get overwhelmed.)

Personal Opinions

If you haven't done the problem, don't read the section, you’ll lose interest/get confused.

This is probably one of the best examples of backtracking I’ve EVER SEEN. I could never do backtracking until now. This feels more like an intermediate-level competitive programming problem… except the fact that the problem is explained a lot. I myself neither implemented graphs nor backtracking before, so I was… confused while doing locked_pairs. Also, I’m very very bad at competitive programming, please don't think like I’m some experienced developer or something,; I’m just an amateur guy doing big projects once in a while…

Anyway, it was an amazing problem. Anyone can learn a lot from this pset.


r/cs50 • • Feb 22 '14

My week 0 scratch project. No experience programming. Is it enough or should I keep going?

Thumbnail
scratch.mit.edu
1 Upvotes

r/cs50 • • Mar 26 '23

CS50x Whats wrong with my code?

Post image
1 Upvotes

Can anyone please help me with error? I have no idea why \n could be an error 🙏🥺


r/cs50 • • Sep 01 '22

CS50x So all the programming is so hard or C is an oldfashioned bull**it ?

0 Upvotes

r/cs50 • • Aug 12 '18

score That's how it works..!

Post image
21 Upvotes