Subtitles section Play video Print subtitles COLTON OGDEN: Good morning, good afternoon good evening, depending on where you are. We are currently based in Massachusetts in the United States. But I know we have many viewers all over the world. This is CS50 on Twitch. My name is Colton Ogden. And today we're going to be taking a look back at game programming, which is what I usually program in. Last week on Friday we did HTML. Today we're doing games in LOVE and Lua. And if you don't know what those are, we'll go over them. But they've been used in many streams before. Today we're going to look at a pretty famous game. If you grew up in the 90s or used computers in the 90s you probably had or at least used a Windows machine. And on many Windows machines, there was a game called Minesweeper and it looked something like this. Let me transition to my computer. And Minesweeper has had many incarnations over the years and certainly not just limited to Windows machines. But this is what Windows '95 Minesweeper looked like. So you have this grid of tiles. And we've talked about 2D tile grids before on stream, particularly with snake as a good example, that snake was based around the sort of 2D grid idea. But you have a grid of these blank tiles that all start off unrevealed. And you click tiles individually. And when you click on a tile, it basically tells you how many bombs are adjacent to that tile. And it considers also diagonal offsets relative to that square. So not just up, down, left, or right but also whether there's a tile in the diagonal direction. And so through inferring based on what you see, what numbers you see when you reveal tiles, you can get a sense of where the bombs are. And if you can happen to reveal every tile on the map except for the bombs you win the game. And you get a certain amount of points, as you can see up at the top of the screen. I believe on the left here, this may be the points and on the right would be the timer. I'm not 100% sure. But in any case, that is the game that we will be talking about today. So let me just read off some of the chat here. And everybody let me know if you can hear me, if everything sounds good. We had a network change, although that shouldn't affect this stream. But I did have to rewire everything up to make sure that it worked. So shout outs to everybody who joined the stream early. So, sashka32, bellocures, lewie0416sdo, that's a name that I haven't memorized yet. I'm not sure if you are a first timer or if you've actually been here before. Mkloppenburg, thanks for joining. You and I chatted briefly in the chat beforehand, saying that you really like the code review idea. So we are going to be doing a code review episode or potentially more episodes in the future. Moididie, thank you very much for the follow. So what we're going to be doing is, we'll be soliciting and we did this on Facebook, where we essentially are soliciting folks who are interested in us reviewing their code. And so I'm trying to think offhand. I don't have a Bitly URL. It'd be cool to have a Bitly URL or something. Let me see if I can really quickly do that. So if we have a-- just go to Bitly. So a Bitly is a URL that allows you to shorten the longer URLs. So we have a form. Essentially here's the gist of the idea for the new program. So you have a GitHub repo or a gist, those two. We're formally saying gist or GitHub repo is public URLs for your source code. Sashaka32, you didn't get a haircut. You're right. I promised I was going to get a haircut on this last Sunday. Couple of things happened. So firstly, we had a blizzard here. And it was kind of a pain to go out in the blizzard in super cold weather, super freezing. And especially because I would be getting a buzz in super freezing weather, I was like, no. I'm not going to do that. And then I tried to get it yesterday and the person that cuts my hair wasn't working yesterday. So I kind of shafted myself a little bit. But I'm going to say, I will do my best to get it done by Friday if not over next weekend. But yeah, I screwed that one up. Anyway, the code review idea. So the code review thing is something where you, if you're a Twitch viewer or otherwise if you're on YouTube or whatnot, you can submit to us your source code for some repo or a gist. And we'll take a look at it and on stream, David and I will grade your code sort of in the same way that we do with CS50 students at Harvard, where we just take a look at your style and your design. So basically, how well is your code formatted and then how well have you engineered your application? Do you have duplication of code? The dry principle, those sorts of basic things. Like is your code well engineered, well designed? Does it look nice? To sort of give you some feedback if you're a beginner or an intermediate programmer and you want to make sure that you're on the right track, we can do that for you. And it would be a cool bit of new content for the Twitch channel. So what I was going to do was, I'm going to the CS50 Facebook group. I'm going to try and get that URL so I can post it in the chat here for everybody who's actively watching right now. Let me just-- I don't want to take too much time on this. But this is a cool idea. I think it could make some great content. Let me get the URL. Going as fast as I can here. OK. Bitly, here we go. OK, create. Long URL. OK. This is going to be-- copy. Actually, let's make it-- how do I edit this? Customize. So This is going to be CS50 Twitch code. What's the best way to do this? CS50 Twitch code review. It's not really that long of a URL. But I'm going to put in the chat now. So bitly/CS50twitchcodereview. Let me just make sure that that works. Bitly, CS50 Twitch code review. Yes. OK. Cool. So that's in the chat now. So if you go to that URL you can submit your code, your source code. So the form is going to expect a GitHub repo or a gist, a GitHub gist, which is another GitHub feature that lets you basically put your source code into one file that you can share publicly. Ideally the code basis should be somewhat small and manageable so that we don't have to spend too much time grecking through a massive code base. We're not going to bug test, so this isn't like, fix my bug. Although maybe that's something that we can look at in the future for a different bit of content. But this is going to be more like, grade my style. Like, how good does my code look? How well engineered is it? Definitely use it for that intended use case. So I'm going to transition back to my screen here. That's all done. Let me make sure that I'm caught up with the chat. So that was mkloppenburg, Martin posted in the chat about that. So if you're curious what he's referring to, that's what the URL is. Submit that link if you want a chance to have your code reviewed on stream. And we may not be able to review everybody's source code, but we'll take a look. We'll definitely try our best. So thanks so much. [INAUDIBLE], thank you very much. Doing a great job. Appreciate it. Bellacura says hi. Tuxman, let's Minesweep today. And tuxman I think also posted about the source code thing. So tuxman's already in. So follow tuxman's example, join the CS50 review initiative. LightOfHell1 says hello. What technologies will you be using for this, says zakillapotato. And how in-depth will you explain what you are doing and why? Fairly in-depth. I would say probably not as in-depth as prior streams that covered the basics.