Placeholder Image

Subtitles section Play video

  • All right.

  • Hello, world.

  • This is CS 50 Live.

  • My name is I'm still in the habit of saying this is CS 50 on Twitch.

  • My name is Colton Ogden, in case anybody is brand new to this sort of ecosystem.

  • See, City is Harvard's sort of introductory computer science course, and we now have a presence on Twitter and YouTube and Facebook doing a live stream where we do from scratch implementations of projects we cover.

  • Well, yesterday we covered Callie Lennox, which was sort of a completely different single together where we kind of go into hacking and cyber security.

  • But today we're going to go more into the former category of projects.

  • Actually, today is very experimental.

  • Today, stream is focused around a text adventure in python.

  • Normally, I code in lieu and love to d making games, and this is a game.

  • But we're gonna do it in Python because I think more people are actually familiar with Python.

  • More people might be interested in python.

  • It's nice, easy way to do.

  • Ah, command line focused version of a game, especially for folks that are sort of Newark to programming and to python more generally speaking, on.

  • I want to shout out as Lee Tea is in the chat today for actually bringing this idea sort of to my attention.

  • In the past, she and I talked about a text adventure it she was sort of working on and creating.

  • And I think she actually has a text adventure that she created herself.

  • And she may be plugging that in the chat at some point.

  • So stay tuned for that.

  • Today's stream is very experimental in that we're actually gonna do everything based on what the chat has to say.

  • So this text adventure I'm not going to write any of this on.

  • And I'm hoping that the folks in the chat are participatory enough so that we have a corpus of potential avenues to explore today during the stream.

  • But we're going to essentially make sort of what you might have seen in a choose your own adventure style game, Um, or even the old books.

  • The choose your own adventure book.

  • I'm gonna pull up.

  • I'm gonna switch to my screen here, and I'm gonna pull up a Google image.

  • Time to see if they have the choose your own adventure book.

  • Sort of pictures?

  • Yeah, these sort of like seventies eighties Isaac Asimov style.

  • Um, like, stylized books.

  • These were cool because you would read these And you can actually say, you know, if you wantto perform this action, go to page like 87.

  • And it was kind of like this.

  • What?

  • The word is off hand, but not asynchronous.

  • But it was sort of not sequential nonlinear, that that's the word I was looking for.

  • It was non linear way of reading a book and actually sort of diving into the narrative and having an effect on how it transpired ultimately is very interesting.

  • I used to read these as a kid, and I think these are kind of the actually sure if these came before the first sort of text adventures like, was it cold?

  • Sore HQ?

  • Is that the name of the, um, the game?

  • Siri's?

  • Yeah.

  • So Zork is another really famous game.

  • Siri's and I actually think I own these games, but I haven't played them.

  • I have been astounding number of games that haven't played, but these are text adventure games that you play at your command line or whatever, and I think some of them had a graphical interface and you would choose sort of how you want to actually play out the game.

  • And if you made the right choices, you would eventually win and beat the game.

  • And if you made a wrong choice, um, you would probably die in some gruesome faction.

  • Actually, Bandersnatch came out fairly recently on Netflix, and this was a, um, black Mirror episode That was a very similar style.

  • So choose your own adventure piece of fiction on Lee.

  • This was implemented in a brand new format sort of through Netflix through streaming video where using, You know, if you're using an Apple TV or using your TV, your smart TV's remote, you could actually navigate through Netflix the different options in the narrative to change the flow of the story and this, like choose your own adventure games and, like choose your own adventure books had sort of the effect of potentially leading you down gruesome and sort of savory paths.

  • But this is cool.

  • This is gonna be an interesting I think way for us to take this format and actually apply it to, I guess, twitch and make it a community driven thing.

  • So We'll see how it works out, Woman As Lee plugged her thing, they're in the chat.

  • And no, Eliza, is this being recorded?

  • Yes, it is being recorded.

  • This will be on YouTube after the fact.

  • Of course, if you're watching this on YouTube, you will not have taken part in the creation of this.

  • And if you're watching this on Facebook or on YouTube, I would recommend going to twitched, at least for today's episode, because the Leighton see on Twitch is less than Facebook and YouTube and I will ideally like to be able to read people's responses so that we can keep the flow going.

  • So definitely tune on a twitch.

  • Twitch dot tv slash CS 50 TV If you wantto suggest options for today's chat Eastland and has some suggestions that I'm probably not going thio plugin because I do not know what that means, Mrs.

  • Google.

  • Something to show good pictures, very good interactive fiction and Russian.

  • I'm gonna have to take your word on that East London That sounds like it could be a slippery slope and is missing again.

  • How long will it be?

  • This would be about three hours.

  • Usually my streams are about three hours long.

  • We may cut it a little bit shorter, Mom, it likes Whip, Streak said.

  • 90 minutes is kind of the lower bound, three hours being the upper bound, but we'll see how we'll see how things go.

  • And I have actually no sort of preconceptions as to how the stream should go.

  • Other that, other than that it will be a interactive text adventure in Python and that you guys will be sort of leading the way.

  • So I have ah, visual studio code project already up and running.

  • It's just called text adventure in my Streams folder.

  • I'm gonna create a A, um, file called main dot pie.

  • And this will probably honestly be all that we need for today because we're not going to super crazily engineer project.

  • It's just gonna be basically one file with a bunch of like, textural options.

  • We'll have some conditional logic, and they're depending on how fancy we get with it.

  • Depending on how people what people want to do, we might end up tweaking things a little bit, but we'll see how things go.

  • It's OK main dot pie, and then python extension is recommended for this file type it is.

  • Okay, I will disable that for now.

  • And I'm just going to say if name is equal to Maine, and then we'll just say made Let's have a function called Main Death Maine, whose goal in life is to print Hello, Twitch or both.

  • Hello.

  • See, City lights were not streaming exclusively to twitch.

  • Where were streaming to a bunch of service is and I'm gonna open up my command.

  • Prompt.

  • I'm gonna actually wearing my right now.

  • I'm in my home directory.

  • I'm gonna go into Dev Streams and then text adventure.

  • Think.

  • And then if I go Python three Main dupuy, this will indeed output.

  • Hello, CS 50.

  • Life's not a terribly interesting adventure so far, but I think the first thing that we should do is we should decide on the title of the game.

  • I think this will be a nice a way for us to get some inspiration.

  • And so I'm gonna choose people in the chat to give me one word at a time.

  • This will be interesting, uh, sort of like that.

  • Choose a sentence in pieces, were in a start with choose the title in pieces.

  • So since, as Lee is the sort of star of the show today because she recommended what we do as Lee.

  • I want you to recommend the first word of the title of this text adventure, and hopefully there's not enough light and see it where this gets to be a little bit sluggish, But we'll see.

  • And then oh, Indra Ready?

  • Good to see you as he's saying, Um, it's a lot of pressure, A lot of pressure.

  • Aliens.

  • Okay, aliens, Aliens is the title of this text adventure.

  • So I'm gonna create a constant up here.

  • And the first word is aliens.

  • Okay, second word.

  • Whip streak.

  • Nate, Let's was the second word of the title.

  • I have honestly no idea where this is going to go.

  • Let's also keep it PG preferably, um so we will not be accepting profanity as part of the stream.

  • Um, but, you know, I'm excited.

  • I'm anxious to see where this leads us, because this could be very fascinating, and it'll probably very nonsensical ultimately the adventure.

  • But that's just kind of part of the fun.

  • Ah, uh, Mirani says, Well, that's cool.

  • Aliens.

  • Nice Alejo Goma injury.

  • The injury is not your turn yet, but you're you're coming soon.

  • And his music again.

  • I'm gonna keep track of all the folks that are in the chat.

  • And I will ask all of you eventually to contribute to this.

  • But just so that there's not a bombardment of, ah, things at once and so I don't have to make choices.

  • I'm gonna have to I'm gonna have to narrow it.

  • Intergalactic adventure.

  • Okay, aliens.

  • Intergalactic adventure.

  • Okay, so that's two words, though.

  • Nate, to be fair, that's two words we're gonna have to stick to.

  • Just one word.

  • So I need youto I need you to sort of focus down.

  • What's one word that you want to use?

  • Could be intergalactic pyros, 2002 aliens and pogo sticks.

  • Misspelling good.

  • Is that the word is Miss spelling the word?

  • That's an interesting word.

  • No trends or says you're new here.

  • Nice to meet you all.

  • Hello.

  • No trends there.

  • Good to see you.

  • Um, Babbitt.

  • Welcome to the stream.

  • We're doing a text adventure live, and everybody is contributing to the text adventure.

  • So currently it's on Nate to decide what the second word of the title is.

  • So with streaks and Nate.

  • What's that?

  • What's word, too?

  • What's the word?

  • Following aliens here in our title.

  • Intergalactic.

  • Okay, perfect.

  • Intergalactic.

  • And then, um Inger?

  • Ready.

  • I want you to give me the third word of this title.

  • And maybe that maybe that will be enough.

  • Maybe this is the end of the title.

  • Aliens.

  • Endgame don't turn yellow.

  • And Babbitt, you're you're You're coming soon.

  • Don't worry.

  • Since you're such a regular, we're gonna get you involved in this ASAP.

  • But everybody's gonna everybody in the chat.

  • I'm gonna try to get everybody involved.

  • Just make sure that you if you're in the chat and you haven't said anything yet.

  • Say something.

  • So I know that you're actually presence.

  • I can call on you.

  • Um, but Inger Ready?

  • We're waiting on writing on Indra for the third word of our title.

  • We'll see how this goes.

  • Marvel aliens, Intergalactic marvel.

  • Okay, that's interesting.

  • Let's Well, that would be the title.

  • That'll be the title of our of our of our text adventure.

  • So of course, what we need to do in Maine is we need a print, our title, right?

  • And so if your brand new the python, I'll try and explain no trends or my name is Michael.

  • Mike.

  • Good to see you.

  • If a branded a python will try to kind of keep it slow.

  • So this is a function main basically lets us say Do something.

  • When I call this function here when I say main parentheses, that means actually execute main actually do what's inside of it.

  • I had to find a function called Maine, and inside of that I'm just saying Print, title and title.

  • All we've said is at the very top is a string.

  • That's what these apostrophe sort of designates some text.

  • And just as aliens, intergalactic marvel, right?

  • So that's that's always done.

  • So far.

  • We're literally just printing a string that says aliens, intergalactic marble.

  • So if I go back here and I print that, then we get printed to the screen aliens, intergalactic marble, Variety says.

  • I used to be regular, but the schedule is so uncomfortable for Mayfield's badman.

  • Yeah, I'm sorry if if it's a little bit later in the day, or maybe it's during a work period and radium.

  • Too bad at choosing words.

  • That's okay.

  • That's okay.

  • And his visit again.

  • Um, so of course we have the title we're gonna need, like, a little short introduction.

  • Eso Let's let's maybe have ah, like a few sentences.

  • An introduction.

  • So the first sentence.

  • Babic, I want you to give us the first sentence of this text adventure eso.

  • We'll have this sort of be introduction intro, local intro, and, uh, we're gonna make it a triple triple quoted string.

  • And what this lets us do is it's actually lets us format the string.

  • However, we want to, um, including new lines.

  • So this is kind of a nice feature of python.

  • So, Babic, we're waiting on you for the give us the first sentence of the introduction.

  • I wanted to be as epic as possible, and then we're gonna call on someone else for the second sentence.

  • But all wait to until we get the first time this from Babbitt before we decide to do that.

  • Um, so so far it seems like this is going in the realm of sci fi, a little bit kind of epic sci fi.

  • So I'm not entirely sure these earthlings are not using their full potential Lovett.

  • These earthly are not using their full potential.

  • Veron e i want you to give us the second sentence.

  • Can you do it for me?

  • Veron e second sentence number two in our intro here, These earthlings are not using their full potential of it.

  • Love it as the first.

  • That's a great first sentence.

  • Ah, wait.

  • Past minute says Veronica.

  • Oof!

  • I'm sorry.

  • You know we're trying to do is we're actually trying to bring the stream back to an earlier schedule.

  • That's why today we're actually streaming at noon eastern time because normally we stream at one eastern time And that's typically too late for a lot of people.

  • But 12 is a little bit earlier, so hopefully we can accommodate some folks.

  • Shin Wyn Chung says hello, everyone.

  • Hello, Shin went good to see you.

  • Can I do this through Spider and is missing?

  • And I'm not sure what Spider is.

  • I apologize, um, and and is missing again.

  • I'm gonna call you soon because you've been you've been active in the chat.

  • Um, I've just started to see if it be glad I've caught this.

  • How long do you normally stream forces beer hunter?

  • Um, we usually scream for about an hour and 1/2 to 3 hours.

  • So we'll see how long today's goes.

  • It's gonna be It's gonna be interesting.

  • We're gonna We're gonna see how I haven't honestly no idea what to expect today.

  • Oh, Anaconda.

  • Okay.

  • Probably unnecessary.

  • Honestly, to use an i d.