Transcription
Hey, my name is Forest. Welcome back. So, it's been a few years since I made this video about my favorite computer science programming project of all time. And it was my favorite because that's the project that broke down that coding barrier for me, that threshold where you go from just knowing you know some of the basics to that "ah" moment where you gain the understanding of, of kind of how everything works together in a program, and you're actually able to write some of your own code yourself, and thinking for yourself, really taking those Basics and and putting them to action.
But the reason this project broke the coding barrier for me is not because of the project itself. It's not anything necessarily unique or special; it's a wrestling tournament simulation. What really did it for me is how I approached building this application, and this is the most important part of this video. Sure, you can scrub through that, you know I have timestamps of when project 1, 2, and 3 are going to be listed, and you can jump ahead, but this video is really about how you build a project, not necessarily the ideas, cuz they're just that: ideas. Good ideas, I think, but if you don't build them properly, they're not really going to help you. How you go about building these projects is everything, well, with a little hint of what the project is about, let me explain.
So, when I built this project, there was no tutorial. That was one of the biggest things; there wasn't someone who had already figured out everything, and I just sat there and copied down the code that they had already figured out and implemented. No, that would be like, you know, reading a book and typing every single word of that book and expecting to become a good storyteller or good author. That's not how it works. So why would you expect, you know, you follow a tutorial or two and now all of a sudden you're a good software developer?
And look, I'm sure there is value in that. It gives you an understanding, a little bit of how things can be intertwined together, you know how someone tells a story and how this character in place now ties into this character in place and kind of their grammar and ver- and there's aspects like that. So like when you're coding, you can kind of see how different functions or classes and variables and parameter- like these little things, how they are working together, kind of it'll give you a slight idea of how things are structured and tied together, but that's really all.
So whatever project you build, make sure you do not follow a tutorial. What you do—because I know what you're thinking—you're thinking, "Well, how am I supposed to code something if I don't know how to code?" That's what everybody says. Is, "well, just just code." Well, I don't know how. Well, if you don't know how to ride a bike, how are you going to ride a bike? You get on it, you ride, you fall, you figure out why you fell, you try again. You're going to fall again a slightly different way and for a different reason, and then you'll try again. Just repeat that process. Coding is the same; you learn by doing, failing, fixing, banging your head against the wall, and R and repeat.
But to quickly touch on that, you don't know where to get started. That's a lot of people's kind of issue; is, "I don't know where to get started." It's like, you know, the bike analogy. Well, what are these? I don't even know, like, are these pedals? What the heck do they do? These handlebars, what do they do? This seat, what, what does that do? I don't even know what these things are named. I don't understand any of it. Well, you see how an application is or like a little program is or like a little tic-tac-toe game in terminal where you can you can kind of look at that and decipher, "Oh, well, there's a board," and I mean, what do you do in real life? You draw out a tic-tac-toe game, okay, and then you go, you put an x over here, I go put an o over here, and then if I get someone gets three in a row, they win. Well, you can kind of break that down. Okay, well, how do I display the board? That's what you start with, and you can Google things, and I'll get to this in a little bit more detail. You can Google things, but not until you really think about how you can take these Basics that you already know—loops and functions and variables, data types—that use those and try to figure out, "How can I draw a a Tic-tac-toe board in terminal? What characters would I use? Do I want to loop through those? How, because there's multiple of each? How would I do that?" That's kind of where you would go, and you just start playing around in the ter- in the code editor and trying to print that out in the terminal. That's what you would do.
So there's that, that's how you would like approach something. But here's the thing: if you really want to learn how to code beyond the basics, do not Google, "How do I build X in absolutely no AI." Now let me show you how to approach coding a project, building a project with limited coding knowledge. First and foremost, pick a project about something you already understand. That way you can solely focus on learning the code and the logic and that stuff. For example, the wrestling tournament simulation that I mentioned was very straightforward to me because I understand how tournaments work and wrestling pointing systems and things of that nature work, and I found it interesting. That is also very important. But later, once I had a more of an understanding of how to code, I coded an LU decomposition solver, where I then spent a lot of time learning about linear algebra and how lower upper decomposition factors a matrix as a product of a lower triangular matrix and an upper triangular matrix.
The only exception to this is if you are incredibly interested in building something, an idea that you want to build, like in this instance using that example, you really want to learn about linear algebra and you also want to learn how to implement it with code. That is perfectly fine. You just have to understand that you're going to be learning many different things at the same time as opposed to just focusing on code, which is many different things within and of itself, but you know, learning linear algebra is many different things in and of itself, so you're going to be learning both of those things instead of just focusing on one thing because you already understand the other. You see what I'm saying? So you pick a project you already understand, and you want to make sure it is extremely limited in scope. Don't say, "Oh, well, what, what do I understand? Well, I understand how a social media site works or app works, so I can just build one of those." Well, I would recommend against that because they are very intricate. You may see it, but you don't realize just all of the nooks and crannies and things moving around that there are within, you know, a a complex site like that. Because if you did really want to build, you know, like a unique social media app, you probably wouldn't be watching this video and instead you be coding that application, because there are slightly different goals there. One is, "I really want to build this app, so I'm going to figure out how to build it." The other is, "I really want to learn how to code, so I'm going to build apps that I'm still interested in, but really focus on learning how to code," whereas this one is just focusing on how to get things done. Okay.
So you have an easy, done, understand project with extremely limited scope. Now break it down, and I'm going to show you exactly how to do this with project one. And yes, I took off my flannel; it got hot. It's it's a whole thing. So project number one is going to be a card game engine. That's a fancy term; really, you're going to recreate a game like War or Crazy Eights or what have you, whichever is your favorite, as long as it's simple. Because what a card game like this can teach you is class hierarchy. You have cards and decks and players and games, so you have enough but not too many. Collections management because you have um shuffling and dealing. You'll have game state handling, turn-based logic, random number generators to shuffle. You'll be working with data structures like queues and stacks. You'll track the score, and you have input validation. A lot of, lot of basic things, right? But that tie together so beautifully into something that you can already imagine in your head as I explain it right now. It just, it just helps. Okay. So that is an easy-to-understand project with limited scope. Now let's, let's break that down. I already kind of did, but like, I mean, really let's do it. For example, let's say we want to go with War, a simple card game like War. What do we actually need? Well, we need cards, right? That is like the main thing. We need cards, and that's probably, I mean, what, what do you think that would be? A class, and you can create objects from that class based on different values, with each card needing what? A suit and a value. And then what do these cards normally come in? They normally come in a deck, that's 52 cards of all the suits, all the values in each suit. That's another class that holds all of these cards. And then what do we do with these cards? Well, we play with them, right? So we need players, two players, War, one over there, one over here. This game, by the way, if you don't know, is when you literally just, you have half the deck, I have half the deck, and you just flip the the top card from your deck face up, and so do you, and whoever has the higher number gets the cards, and your goal is to get all of the cards, whereas the other person runs out. If you run out, you lose. And then there's also an extra part of this is when you tie. So you put down a 10, I put down a 10, then we're going to have to go to war. So you put three cards face down with the fourth one being face up, and then whoever card is higher, then you get all of those cards, the original card, the three face down, as well as the one faced up. If it's a tie again, then you do it again. So yes, we will need two players, and we're going to give the cards to the players, right? So keep that in mind. But then we need the actual game logic, so like comparing cards, moving the cards between players. You see how we're breaking this big idea of a card game into all of these little bite-size pieces that are, I mean, much more manageable. It really actually allows you to break down and see just how limited in scope your idea is. Some of you are going to be like, "Oh, this is an easy idea," and then you start to break it down, you're like, "Whoa, this is a lot," but you know, a project like this, it, it, it's, it's just enough so that you can really understand all of the different things that I went over before and how they tie together while also not being overwhelmed and actually, you know, building a project that you'll finish and not spend 6 months on and still not even be halfway done. Don't ask me how I know that. I still have projects like that, unfortunately.
But yeah, so we're breaking all of this down into smaller, more manageable pieces. That's what you need to do with whatever idea you choose. And now remember, we know the basics, so that's why we can kind of say, "Oh, well, yeah, maybe cards, that would be a class, and then the deck would be another class, or or H how are we going to handle the cards that are in your hand? Are we going to put that in an array? Oh, I know what an array is; that, that stores a list of things, list of cards. Okay, hm, well, how are we going to, you know, take one card and put it in the middle for both players? Oh, I remember watching that one algorithm's video about pushing and popping from, you know, the far Night YouTube channel. Oh yeah, okay, I know how to do this. Slight little plug, sorry, of literally this channel that you're watching. Anyway, but seriously, like, you know, variables, you know, loops, like for loops, you know, if statements, you, you know, classes and and things of that nature. You may know them all separately, but you still know them. So now what you want to do is not Google, "How do I do X, Y, and Z," but like, "how, how could these fit into those things?" They may not be the most optimal, but they, they can work. So like I said, for a card game, you know, you want to store those uh cards in an array or list, which isn't a list in Python, just an array, but it's dynamically resizable, so it's like an array in JavaScript. I don't know, I'm not a Python dev. But then also you're going to use random number random numbers to shuffle them, right? Because you want them to go randomly. And then in order to compare your card to my card, we can use an if statement, right? Hm, if this is greater than that, then who gets the cards? Oh, let's add these cards over to so-and-so's array, whoever the winner is, or list, you know, to their cards to the bottom of them. Okay, not to the top, to the bottom. That's how it works, or actually technically you put it in another array, and then once you run out of cards in your current array, you shuffle that array and then use that as your current array to then use on the people. Play War differently; you do it however you want. And then once you do this, once you have like an idea, maybe you're writing it down, or you can even be in your your code editor in writing comments, like, "Oh, you know, let's cards class, and then player x cards array." That's not a very good name, but you get the idea.
If you don't remember how to do any of this, just go to whatever the documentation is for the language you're using. In my head, I'm doing it in Java, so in Java, go to the Java docs and figure out how to properly declare an array, initialize it, um, assign values to it. Just read all of that in order to get an understanding of how the syntax works if you can't remember properly. Because when you figure all of this out, that's, that's really, that is your starting point. That's really how you want to approach it, and you want to spend a lot of time on this. "Oh, I can't figure it out, I can't figure it out." No one said it was going to be easy, but just read the documentation. See, maybe, maybe you'll get some ideas based on all of these things that you have broken down from the big project, and you have, you know, classes and arrays and this variable whatever. And after you have done that, and you if you still can't figure out how to shuffle a deck of cards, shuffle the deck of cards. Don't look up how to shuffle a deck of cards in Java. Well, what did you, what did you write down that you're going to do? Oh, well, I, I want to randomize this array, right? Well, how do I, how do I randomly sort an array? That's what you want to look up. How do you randomly sort an array? Because now you've already figured out ex- exactly what you want to do down to the minute details of, "Okay, I want to randomly sort this array." Then if you just don't know how to do it, then you can look it up, or you tried to do it, you can't figure it out, then you look it up. But after you've already done all of that due diligence, if you will, that's the only time you really want to start looking things up, and you have to look up the actual programming concept, like I just said, not how to shuffle cards, but how to randomly sort an array. And whatever you do, do not copy and paste the solu- ution into your code and hope that it works. No, what you have to do is actually read the information around it, read the code itself, do everything you can to understand what it is, what it's doing, how it works, so that way you can then go in, still not copy and pasting, type out everything, figure out why it's doing what it's doing, and then go from there. That's the only way that will help you understand the core concept as opposed to just getting the thing to work. And if for whatever reason you're working on something so unique and so crazy and so this and so that, a very niche thing that you've already broken down and figured out kind of, but you can't like really figure it out, and you read everything and this and that, that is the only maybe potential use case of AI with your coding when you are learning how to code. And I feel like it's blasphemous saying it, that you can actually use some AI to learn to code, but really only in that very niche spot. And I'm only mentioning this because I want you to use AI correctly as opposed to me saying, "Don't ever use it," and then when you use it, you don't use it correctly. So don't ever use it, but if you do, this is how: treat the AI as something that you can just kind of like bounce ideas off of. Do not use AI to solve the problem for you or write the code for you. That defeats the entire purpose. You do those things; the you cannot let AI become a crutch. I've seen this happen nowadays so many times. It's just, you got to remember why you're doing this in the first place. You're not coding these projects just to get them done. And if you're in school and you're like, "Well, yeah, I am, just so I can get a good grade," you're not in school to get good grades; you're in school to learn the material that you're being taught. You're going through these courses on your own, online, in class, self-taught, what have you. You're doing all of this to learn how to code better, not to just simply get it done. And that's not just writing code or syntax; it goes from identifying the problem to to figuring out potential solutions, trying to figure out how to implement those solutions, and then writing the code to implement those solutions, hoping they work, and they probably don't. So then going back to the starting board, "Did I identify the correct problem? Okay, yeah, maybe I did. What about this other solution? Can I try that? How do I implement that? Let's write this in code, and then now see if it works. If it doesn't, rinse and repeat." That's quite literally, quite literally—I hate when people say "literally" all the time, but I'm serious—how you learn to code is it, it's trial and error. That's it. And if you are outsourcing the trial and error to an AI or to someone else, then you're not the one learning.
All right, now let's move on to the next two project ideas, and I'm not going to go as in-depth as the first one, but I hope that give you an idea of how to approach ideas like this so that you can do it yourself. That's kind of the whole goal. Like I said, one is going to be a wave for it, or I guess it's project two, weather station data analyzer. Not just you're not just accessing an API and displaying the data, which that is also solid because you get API—I mean, that's a very general, popular one—this is, it's basically everybody's introduction to APIs, right? External APIs and G getting information. Anyway, this is where you build a program that processes and analyzes weather data. And some of the key learning elements here are, well, you're going to have to take that data and store them in some sort of data structure. Data structures. You're going to want to do file input and output, right? You're going to want to parse that data and validate that data. You're going to want to, you can do some basic calculations to get the average temperature or the minimum or the maximum. You know how to do that in math, right? Now you can implement it with code. And then where you going to store that information once you do those calculations? And then what about those averages and minimums and maximums for the summer or the winter? And then you can kind of manipulate the data that way and group the data that way. And then you're going to want to filter through those however you see fit and generate a report based on that information. There's a lot you can…
Do with this and it's something that is it's pretty cool, because it's it's again very straightforward; that's the point of the, and you get to use a lot of things that you already know. I really like this idea, and if you want to take it a step further, then sure, go ahead and gather that data via an API if you really want to, but you don't have to. You can just literally download the report and figure out how to get that information into a data structure within your code; that's your starting point right there.
Now, project three. Sorry, it's not going to be super unique, but I have to do it, even though I made an entire video on it and I've recommended it in at least one or two other videos, and that is quite literally the wrestling tournament simulation. But it doesn't have to be a wrestling tournament; it could be—I mean, the World Series is going on right now. It's over by the time you're watching this, I think. Congrats to probably the Dodgers if I had to guess, but whatever sport or whatever thing, like it can be a chess tournament. Don't do chess operations, just, you know, "oh, this winner over here, this winner over there"—um, how do their ELOs change and things of that nature? Like, you can do whatever interests you, just in tournament style. They're talking about doing a BMF belt tournament for the UFC, even though Max Holloway already has the BMF belt, so how is he part of the tournament if he's the actual like—he should be; people should be in the tournament to face him. Anyway, except that he just got knocked out by Ilia Topuria; that's unfortunate. Sorry, I sidetracked. Max Holloway has been my favorite fighter since I got into the UFC many, many years ago, so it's sad. But anyway, so this whatever you choose, it'll it'll model a real-world system with real um rules. You're going to use classes for for wrestlers and schools and conferences and whatever—this could be countries, ELO rankings. You see, again, I'm not supposed to do this for you; you're supposed to do it for yourself. You got to figure out how you want to go about seeding the tournament. You know, think about the logic there; however you want to approach it doesn't have to be wrestling—again, approach it however you wish.
But if you want to take this a step further, check out the Thinking and Code course on brilliant.org. It's a level one course course in their CSN programming section, and it'll take you through writing programs, practicing writing programs, simplifying those programs like I talked about, practice doing that, loops, patterns, recognizing those patterns and everything you would really need to know in order to really prepare yourself to tackle a project by yourself, to break the coding barrier. Brilliant isn't just limited to that; I mean, just take a look at all of these learning paths: you have programming and CSS, you have data analysis, foundational math, science, advanced math, in just an entirety of 60-plus courses; courses that are interactive, that are easy to understand while still letting you figure it out. And take a look here; you can also see some of these other computer science courses about designing programs and computer science fundamentals, as well as algorithms and data structures over here, Python, if that's your thing. Earlier in the video, I said I'm not a Python dev; I'm not, but maybe I should take this, and it's a site that I personally love. I don't need to take some of the basic-level courses right, but I love to spend just a little bit of time learning something new, and a lot of the times I'm doing that on Brilliant. So go to brilliant.org/ForrestKnight because there's a special deal waiting for you; that special deal being 30 days entirely free, as well as 20% off their annual plan. Thank you to Brilliant for being the sponsor of this portion of today's video.
If none of these projects are appealing to you—I hope some of them are; again, I I really like them—but if none of them are, you can check out this video about programming projects that take you to the next level, or this video, which are programming projects every computer science student will build, or, you know, similar projects. I mentioned Ludum Dare, right; that's featured in this video. Maybe one of these will be more enticing to you, hopefully. If you didn't like any of the ones I went over in this video, whatever you choose to do, just make sure you actually do it, and you do it yourself.