CS50 / Week 0: Friday

Uploaded by Harvard on 24.02.2010

well thank you,
all right welcome , my name is David Malan and for those of you joining us for the first
time and this is the CS50 and this is the continuation of week zero for those of you
who may have missed Wednesday know that we still have some syllabi outside
no more cake, but if you did in fact miss Wednesday, do notice that on the course's
web site
is, as will always be
so that there is what you missed on Wednesday so in the future you will find that the course
makes available it's videos in flash formats, quick time formats as well as in
mp3 formats
on the courses web site so did take a look at that
so we've been hard at work over the past couple of days, particularly one of our CA's who actually
is an alumnus he lives in new York his name is Wellie, he may meet him in the virtual
terminal room over time
and we've implemented what we're now calling
shuttle boy voice
so you may recall,
and you may in fact, if an upper classman, have used
this before
this program called shuttle boy it's a good twelve plus years old now
it lives via this link on CS50's own web site here and let me
grind to a halt here
alright what's changed to this,
so what you will see in a moment
my name is David Malan and in this is CS 50 welcome back to week zero continued
we will crop off of the video everything that just happened if you missed Wednesday’s lecture
video know that it is available
online I won't belabor that particular point but I will draw your attention to a little
application that we've been working on so for some time there has existed this
program called shuttle boy
I'm say, at memorial hall, I need to get back after class to the Quad so I click on two links
and voila, there are the next several settles I can get to
well we thought it would be fun
to take things to the next level this year and to implement shuttle boy voice the
new and improved version of the same idea
as you may recall from Wednesday
we were lucky enough this year to secure 617-bug-cs50
it's not quite yet in production this is really just a sneak preview
but in a moment I'm going to turn this microphone on and we're going to make a phone call together
and see who here picks up so I'm going to go ahead and turn on my speaker phone
we're going to dial and see what happens here
This is CS 50
for Shuttle boy press one
for crimson dining, press two
to start over press zero
I'm going to press one for shuttle boy. What is your origin? for Quad press one, Mather press two, Boylston press three
Lamont press four
mem hall press five. mem hall. What is your destination?
Quad press one
the next shuttle leaves
in five minutes at Eleven PM-and then at
eleven ten PM-, eleven twenty PM
and Eleven thirty PM
so you're going to be here a while today
is perhaps the immediate take away
so that's not a bug, that's a feature. we just dummied it up with some data for demonstration sake
but it should debut
for all of you this coming week and notice we've optimized for the most popular stop so
if you want to get on
for instance at Pound Hall, it's not going to happen with Shuttle boy voice, Quad, Mather, Mem Hall, Boylston, Lamont
all the popular stops
will be optimized in that interface
so more to come
why do something like that? Well frankly sometimes as you'll see perhaps in this course
and beyond you do things
just because you can
by courses end will you be able to do
all that and much more. So today is ultimately about laying the foundation
for the semester and the semester is about computer science it's about programming but that
sort of begs the question perhaps on day one
what is the latter? What is
programming? can someone in layman's terms
give us an answer to this question what is programming?
you don’t want to be down here because I can see you much more easily, yes
ok so writing a set of instructions to a computer so a computer is just this
fairly dumb device, it’s a mechanical device
that literally can only do
what it is told, so programming
is ultimately about
telling a computer what to do. now how do you tell the computer what to do?
well in this course and in programming and computer science
we don't mean you just point and click and choose this from the menu
and at that high user level, but rather how do you actually go in under the hood and
make all of that possible
well you do this with programming languages, C is the one we'll focus on in this course, PHP and
Java script, and C sharp and a whole bunch of others. The history is littered
with about dozens hundreds of programming languages
some of which are very much still in vogue, some of which have
partly died off some of what's really never saw the light of day so
today and we're going to focus on programming ultimately
but not by way of C, not by way of Java and not by way of these textual languages
that while powerful ultimately,
and the languages that we'll use throughout the semester
they're not quite the easiest things to get excited about at terms start in fact what I'm going to do here
in just a moment on my
machine is pull up a little program that comes with Mac OS, you can do something
similar in windows and you'll see how to do this on your own computer before long
but this is a terminal
and what it ultimately gives me
access to is the files, the programs
all underneath the hood on the Mac which is essentially a Unix based computer
so what I'm going to do just to underwhelm you here on day one of two you so far, I'm going
to go ahead and write
hello dot C
so this is text editor, this is like a geek's version of notepad or Microsoft
word but much simpler than
in the latter certainly what I'm going to do is something
like this so include
standard IO.H whatever that means I'm gunna say int, I’m gunna say
main, I'm gunna say int argc, char * argv a couple of brackets
and a parenthesis and then in here I'm going to say
let's say hello comma world and then whatever this back slash n thing denotes and then
a semicolon and so
it's really hard to get excited if this is what you've got in store for you throughout this
semester plus
what is int, what is argc, what is char, why all this syntax?
well it's a very fair question and it's really not intellectually all that interesting we
do ultimately need conventions
we need
a language we need some basic definitions of
how you express yourself to a computer
that's really not interesting here in week zero thus far and so
we'll quickly move away from this but
just to again as promised underwhelmed you
now I have a file called hello.c
just like .text or .doc, the .C is just the convention
I'm going to run a program called gcc
which is a compiler, if you're familiar with visual studio something like that it's the
same type of program but in a Unix or Linux environment
and I'm going to say to the computer compile the stuff I just wrote
in other words turn it into zeros and ones
now the fact that no messages got printed
so on week ends when you're actually playing with C for yourself
for the first time
if you get a message at that very first point
damn that means you've messed something up already but that's okay because much of the process
of learning and in doing interesting things frankly will be tripping over some basics
over time
I've not put my own foot in my mouth here yet
but there's now this file it's cryptically named a.out just a stupid convention
someone came up with years ago
we can change this ultimately and we well
but inside of this file are a bunch of zeros and ones that ultimately this computer
this Mac, this intel Mac can understand. So I'm going to go ahead and hit enter
and voila, your very first computer science program
thank you
alright, so not too terribly exciting and the thing is we don't need to focus so much on just
these basic things like parentheses and semicolons, all of this is completely uninteresting
and we'll get there but you'll find that it's really not such a big deal when it begins to come
more naturally
but today we focus for just this week zero on programming itself and what it means
to make computers do what you want
but doing it in a much more intuitive way and we do this as promised on Wednesday by way
of this graphical language developed by MIT's media lab a couple of years ago
it happens to be called scratch
and what we'll see here is another demo of what you saw briefly on Wednesday
and this one I will give you
not one
that I myself have made but a former teaching follow the course
I give you by way of this demo
raining men
so hopefully much more interesting than hello world at the command prompt, now granted that
was made by a former teaching follow
in fact one of the stars of the football team so realize we do get all types here
at CS50, not those that I
might have recalled from my own high school
but this one is clearly
more presentation oriented than it is interactive and a lot of what using computer is
is taking input and then producing output actually interacting with a human
so why don't we do just that in fact lest we send the message that only teaching fellows
can make things that are this much more interesting than hello world
let me show you something that was made by a former CS50 student
but for this who need one
volunteer to come on up here and
stand before my keyboard
yeah I in the back on the edge there come on down
and you do have to be comfortable again being on camera sense what you don't see happen
is the signing of legal forms off to the stage once we are done
with demonstrations like this so what I'm gunna do is bring up a demonstration this one was
by Andrew Barry, this next one is by Anne Shi
and this one
oh come on
no turning back now
may look familiar
if you've played
a little something like
this before
so some of you may have played DDR or this kinds of coordination games, maybe not, if not
it's better for the demo
so in a moment
and what is your name
Jonason, Jonason, David
nice to meet you
and them
so we're going to hit space to begin and what's going to happen is music's going to start playing
as those instructions hear say, you’re going to have to hit the arrows in lockstep with stuff
that's flowing up the screen so that it overlaps the shapes
and then we'll keep track of your score and just how awesome cool good or
boo you are
you ready to go?
arrow key is down here we are
alright how about a round of applause that was pretty damn good, nicely done.
so how does one go about
writing this stuff, well the interesting questions today
see the legal form, there we go,
so the interesting thing today is going to be to try try and dissect, intellectually what's
going on, right, these things might be fun and they might look silly
but there's really some interesting stuff going on underneath the hood right, there's
some randomness going on there the game is not always the same in this particular
in the previous case with raining men there was clearly synchronization there was lots
of stuff going on at the same time
and if you think back just a moment ago to what I did at the command prompts the
textual interface,
it's hard to imagine how you could possibly coordinate all of those several things going on
when I've completely underwhelmed you thus far by just
printing a simple instruction to the screen
and I'll give you a quick teaser too
of, in a little bit
of one that I wrote that we'll use for the sake of discussion if only 'cause I understand
what went underneath of what's underneath the hood of that one best
and that one we'll see is called Oscar time but first let's consider
outside the context of this thing called scratch what really programming is all about let's
pick something completely silly
so waking up in the morning and putting on one sock. right you've probably hopefully never really
thought hard about this particular problem you just do it
but suppose you were trying to instruct a computer to do it or maybe more concretely,
a robot to do it
you kind of have to think
a little harder
now perhaps I've raised the bar to volunteers a bit higher but I need one a volunteer
for this thing as well
yes come on down
and you too will be on camera
and shoeless
so I went shopping beforehand
turns out you can buy some amazing propaganda at the coop
this is ultimately going to be about
this algorithm here, oh come prepared, what is your name? Josh.
Josh, alright Josh come on over
come on over to your chair here, we'll need you to take off your socks
I kind of splurged here with a few different styles here today so
these here they're all clean though I thought for a moment and maybe I'd just go home for this
but then I thought that might not over so well
so we have some H branded socks here which we'll put
say in the sock pile
I also got some more sporty socks if that's
this is what your preference so we have these
sort of low rise type stocks saying crimson
and then these were actually my favorite
because you know there is some tourist out there walking around in these somewhere
so we also have a pair of these, so an algorithm ultimately, as we'll see in just a moment
is a procedure, it's a program
but it's not necessarily written in a specific language and in fact what we see here on the board
is what we'll call pseudo code it's not quite code, it's not programming code, it's
certainly not zeros and ones
but it's kind of a cross between something that's very succinct and logical
and it's also nonetheless very human readable and so throughout this semester
before we sit down and start typing things away at a command prompt like I did
or even dragging and dropping it’s often worthwhile thinking
about how could you express this program
in just English or English like syntax
because then you can work through the logic then you can think through hopefully some
of the bugs, some of the corner cases
and then proceed to implement that algorithm
so we're going to go ahead and use Josh here for the sake of execution
and we'll see if we can't tease apart a few program fundamentals
that will then recur in much more traditional contexts than this one
so Josh if you would perhaps think to yourself
the following let socks on feet
all one word I seem to have used this underscore notation just to tie it all together as one
we'll let socks on feet equal zero
so this is easy this is a variable right just like X and Y and Z in high school were variables
that stored value so is socks on feet a little more interestingly name variable
that is in fact consistent with reality so we're initializing our program here
so two
line two and this is what we'll call, and this term might be self-explanatory, a loop
so something that repeats zero or more times now in this case I've used the key word while
which does imply doing something while something is the case
we'll see terms like for and do for and do while
and similar synonyms essentially but for this we chose this, so while socks on feet
exclamation point equals two
now if you don't know what that means
take a stab at what it might mean
so not equal to, so bang equal sign
so computer scientist geeks say bang not exclamation point
so bang equals means not equal to two so we're going to do the following while
Josh presumably has zero or one
or you know maybe even three socks on his feet 'cause going to do this while it's not equal
to two
so here's where your awkward role-play comes in
open the socks drawer
look for a sock
if you find sock
so this too, it’s bold-faced for reason this is a condition a branch something that
happens optionally if something is true or false so if you find a sock, have you?
okay then and notice the indentation here to so this is something we'll use
consistently this is a matter of style the computer often does not care if you have spaces
tap characters indentation no indication
and those of you who have written HTML for web pages before probably know that
it might look pretty to make everything nice and hierarchical and pretty printed as they
but the computer certainly doesn't care
but here we're humans, we do care so it's indented to imply
that line six on down
are now encapsulated inside of what
line five is telling us to do. so if line five is true, if find sock which he did, then
we proceed to the indentation put on sock
socks on feet plus plus this is short hand notation and we'll see this in C, Java script, PHP,
plus plus as you might infer
just means incremented by wants, so socks on feet
now equals one
look for matching sock
and this we might call a statement any time it's just sort of matter of fact here we'll
call that a statement okay
you've looked
if you find a matching sock
then, indentation, put on matching sock
so far so good
socks on feet plus plus, close sock drawer and now notice
I'm not going to proceed to do anything with line thirteen 'cause line thirteen is exclusive
with respect to nine so if I did nine I don't do thirteen
similarly if I did five
I don't do sixteen
and now what do I go back up to? well following the logic of the indentation I now go back
to line two
and I check this condition, while socks on feet not equal to two
what do I do now?
I seem to move on so what's next so line
eighteen which isn't even present so implicitly drop out of the program and we're done.
so that was actually very good and now if you wouldn't mind that's restart this take off
these socks if you would
and now it'll get
awkward for me
so I'm going to take
say this, this and this
did we screw up? is this program actually correct well let's see let's socks on feet
equal zero good while socks on feet not equal to two good that is true indentation
open socks drawer
look for sock
if you find sock then
put on sock
you'll always remember this moment in college
socks on feet plus plus. look for matching sock
problem. if you find matching sock then line nine doesn't seem to apply so we go to line
thirteen followed by fourteen else remove
first sock from foot
socks on feet
minus minus
so now we're back to zero presumably what line do I go back to next?
yes so not five, I heard, but rather
so I'm back up at two so while the socks on feet not equal to two,
ok true so we need to open sock drawer, look for sock if you find some then
put on sock
by this point you're probably getting a little bored right, because what's going to happen
right so this is what one of those things called an infinite loop, or if you've
never heard of that expression, that's what it is and frankly you've probably experienced this
before whether you have a Mac a PC, or whatever
you've probably at least once in life gotten really ticked off at your machine
because it's kind of just
hanging, and
hanging and hanging for the stupid hourglass is just spinning and spinning and spinning
and it never stops for some reason, well what is that?
well technically it could be any number of things but it's probably
a mistake that some programmer made
didn't anticipate the fact that maybe I haven't done the laundry all that often and therefore
it might not have
sufficiently many socks maybe I just don't
have certain socks anymore 'cause they got torn and I threw them out
these are what we call corner cases
and clearly bad awkward things arise
if you don't handle these cases, so in those cases with your own machines you probably
rebooted or you force quit or you pull up the task manager all these stupid real world
that boil down to stopping the program
that's caught in an infinite loop, are there other bugs here
that we might trip over?
yeah so I don't, so there's also some real-world problems here perhaps especially if this is again
not Josh the human but Josh the robot
where it keeps saying open sock drawer, open sock drawer.
like what does that even mean? I mean either the robot's going to start ripping the thing out
of the wall or it's just going to get confused because it's ambiguous and ambiguity is ultimately
a problem too
because what
is going to happen in cases that are not so explicitly specified by you
so I would put Josh out of his, his awkwardness here
you get
about six souvenirs today, they are clean
I can give you a little shopping bag if not the receipts if you want
but here we have some nice little Harvard souvenirs, so perhaps a quick round of applause for
Josh, thank you very much
Alright, so this is what we did at the command line quickly this is what will do a week plus from now
this week we focus on things more intuitive
but this is a basic C program, a canonical program
and in fact it will get much more interesting much more powerful than this
but what really happened underneath the hood when I wrote this little program
well if that's my program at top left
and I ran that program called gdd, right, the compiler, well what that compiler did, and it was written
by some smart people a while ago
it converts what kind of looks like English but is definitely not English I'm used to writing
it converts it to zeros and ones that my particular computer understands and this process is called
and this is partly the reason why
if you've ever bought a program maybe Microsoft office
you either buy the shrink wrapped box that says for windows
or you buy shrink wrapped box that says
for Mac OS
because even companies like Microsoft very often have to
essentially write two versions of the programs because the compiler
as I hinted at with my own Mac,
is kind of machines specific or at least it's operating system specific
so unfortunately we don't really live in a world
that's as perfect enough where by Microsoft writes their program once
and they run gcc on a mac, they run gcc on a PC
they put, they copy the resulting a.out file or MSword.exe file to a
CD and ship it
there's a lot more to it than that
so one of the things we'll talk about closer to terms end is the notion of
cross platform software, java, one of the appeals of java if unfamiliar
is in theory you're supposed to be able to write a java program once
and then run it on any computer you wants, a Mac
a PC, Linux box
even a cell phone these days
and you'll use a program like this the virtual terminal room to which I referred on Wednesday
for virtual office hours if you decide to log on
that's actually you'll see a program written in Java
because that particular company called illuminate
decided it's really expensive and it's really uninteresting for to write our
multiple times just so that we can have Mac
customers, PC customers and so forth
so they went with Java but there's downsides even
to that.
So what then are we going to do this week? It is scratch and today what we'll do is lay the foundation
for just these basic programmatic constructs
but by lecture's end today
we will already begin our transition to C, your first problem set, which will be
as will be typically the case by seven PM- tonight on the course's web site
if you're like me, you're welcome to dive in at seven 'o one
if you have more going on you can wait a few days because you have ample time for this one
but they'll be posted on the courses web site at CS50.net
but let me encourage you to take note of this to you
so especially for this first problem set you'll find
that it's rather fun, and in fact you'll probably get a kick out of sharing or making your roommate
take a look at what you've actually been working on
but so that you don't feel completely thrown into
the lion's den so to speak especially if you're feeling a bit among those less comfortable
we will start office hours this coming week. So no sections just yet
we will start the process of sectioning next Wednesday onwards, so more on that next week
but office hours, this list will grow as our
fifty-plus person team begins to figure out their own schedules
we're going to hang out next week on Monday Tuesday Wednesday Thursday evening seven pm
onward, in Cabot house's dining hall
and in Quincy house's dining hall
you can bring your laptop, hang out for brain break and a number of the teaching
fellows and CA's will be there to help you
to chat with you
and just generally tackle this
as a team. so what are you going to be tackling?
well this year
it's scratch. I went to a website called scratch.MIT.edu
and it works for Macs, works for PC's. I downloaded this program
and voila, this is what I get. well what is this interface? well
on the left-hand side here we have these
puzzle pieces and they literally look like puzzle pieces that in a moment
I'll be able to drag into the scripts area here
and it's by dragging and dropping these pieces that I will be
programming so to speak
while in the top right, we have what we're going to call the stage, this is the where stuff
happens as we've already seen this little cat
by default
this is scratch, sort of the mascot they went with but we can change his appearance at will
this is what we'll call a sprite
a sprite or really it's what we'll call more technically a thread
a miniature program that you can instruct to do things independently
of anything else. And at bottom right here
we'll see all the many different sprites
that I might possibly create
so let me go and do this so control
when the green flag clicked
so when I a moment ago typed that cryptic sequence of instructions int main,
main kind of has some implied meaning this is the main guts of my program
well this is sort of the equivalent so those of you coming from to the course
from like a java background
it's like writing your main method
so this block just to be clear
has this icon on it that says when green flag clicked and that's why, if you've been paying close
every time I start these demos, I click that green flag
so what does that mean that means when we click that green flag
this cat, this sprite,
because he's currently selected
is going to do
whatever the blocks tell him to do that are attached to you
this particular starting point
so what do we want him to do? well let's do something simple. I'm going to click the little palate here
for looks
so these, MIT has nicely color coded things just so all belated blocks
are similarly colored
I'm going to flip through and okay, here this is interesting say hello
so hey say hello for two seconds and just because it's a little small that's what that
puzzle piece looks like and notice too, and this is the magic of it,
you bring it close enough it snaps together
alright, it's a lot more easy than remembering, a lot easier than remembering, alright I put the
parenthesis and then the semicolon and then hit enter
you just try to drop and these things will fit together logically if that makes sense programmatically
I’m going
to click the green flag
wow alright so I just wrote
what was
a moment ago
not so bad but not that interesting in fairness
so let's do something a little more interesting so let me say something like this what is
your name, question Mark
so now I need a way of actually getting input. so how can I do this, well under
sensing here
there's this block
Now ask what's your name? and wait, now let me me try and do this so what's your name, oh wait
this is already
a bug. I have kind of gotten ahead of myself so let's do this
we'll I'll say that for two seconds and then ask this
and then wait, well let's see. hello.
what's your name
alright, David
kind of a stupid program right? I've asked for my name
but I'm not doing anything yet so that let's do something a little a little cute perhaps
so looks how about
let's see so there's the say block there's this think block, let me plug this in
now I don't want it to say hmm well okay
we'll let it say hmm, but then it's going to be a little cute
and say something like
umm let's say
doesn't ring a bell
and actually hmm is a little generic, so let's do something even more interesting still
under sensing notice that there was this answer here
and if I had actually gotten some help about this block
I would've gotten a little cheat sheet, what does this do, so this programming environment it's actually
very easy to boot strap yourself because all of the help is right there for you
I'm actually going to drag this and then notice that
that hmmm
doesn't have to be manually typed, I can actually plug in this variable
so now I go ahead and say
this, hello
what's your name? alright, David
and that's a little cartoon bubble there
doesn't ring a bell. alright so baby steps to be sure, and still not all that glamorous,
probably not you're not tapping your roommate on the shoulder just yet
so what more can we do with this? well let's see if we can't
take things progressively higher and higher and to what you'll see is even though a lot of these initial
demonstrations are terribly simple
that's what programming ultimately is about is taking some very basic building blocks
and building on top on top and top of them
kind of combining them into things will start calling functions and libraries
so that you don't have to reinvent these interesting wheels all the time
and so finally do you get much more interesting software, case in point things like
shuttle boy that we don't
have to worry so much about these minutia
before long. so there are these things called statements in programming and in scratch
anything that is a block that's sort of imperative, say this, wait for this amount of time
play sound,
we'll call these statements and these are just a few examples
so here are two programs,
the left one we can figure out intuitively, so when green flag clicked,
that example's going to say "oh hai, world!" for one second then it's going to pause,
it's going to say it again
then it's going to pause,
and then it's going to say it again.
alright, rather underwhelming let's go ahead and pull up the third version of this though,
and all of these examples you can download from the course's web site
let me go ahead and pull up hai3.sb
double clicking suffices
that's the program notice there's really not much complexity here, I still have just one
let me go ahead and click play now
okay still maybe not roommate worthy but let's see
where else we can go with this. Alright
so there's Boolean expressions in programming languages. A Boolean expression,
named after a Mr. Boole
is an expression that in the end
is either true for it's false. it's either one
or it's zero . It's yes, it's no. these two dichotomies, it doesn't matter what labels
you slap on them but it's this notion of true or false
so what kinds of questions might return yes no answers true false answers
well is the cat
touching the mouse pointer?
in other words is my mouse hovering over him? because he is that could be an interesting
mode of interaction
is the mouse button down?
that too is kind of an interesting question to ask because if so maybe he'll do something
is something less than something
well sometimes it's useful to do numeric manipulations
even in a context like this,
and then there's this
this Boolean and operator, if any of you are particularly savvy with Google or search engines
sometimes you might realize that you can type
David and Harvard into Google search box or something like that
to get results that actually relate not to David
or Harvard, but both of them in fact. And so we can merge Boolean expressions into
singular units
why is that interesting? well if we can ask these yes no questions we can do things
or not conditionally just like Josh put on the sock
only if he found a match
can we similarly distinguish between different states of our world here, so there's this if
block in scratch at the far left here so if
something you notice there's this funky triangular shape here too so you'll find that there are
similarities not just with color in this program,
but also in the shape of the blocks so just as a visual cue what can you put into that
but it's not just interesting to say if something's true do this,
sometimes you want it to be exclusive, do this else do that
and so there's this if else construct
so sometimes you can, you might want to do this, that
or the other thing
well these things connect so even though it doesn't look like you can cram
another block
inside that middle one, else, I mean it's only this big, how in the world do we fit anything in there
well what you'll find is that scratch automatically adapts itself, it just grows the size of the
if you want to squeeze more blocks into it
so now we have the ability to do things conditionally,
well why is that helpful well let's take a look at
iteration four of this
so I’m going to go open
hai four.sv
it's not a very interesting program yeah it's so let me hit play,
I'm going to hit it again,
this is sort of a vacuous true right this is not
a very interesting use
of a condition
because one's values are presumably never changing so let's hope I did something a little smarter
with version five here
this is version five of the same idea
so now the fact that we can plug in values from elsewhere this gets a little more interesting
so this block here, let me zoom in,
is what we'll call a pseudo random number generator
now to the target audience of scratch which is usually
people about yae high, so ten-year-olds twelve-year-olds,
MIT's teachers whip out terms like
now here's a pseudo random number generator to make your cat move
but that's what we're going to call it, right? and we're
in this case going to pick a random number how that gets picked
is actually an interesting question unto itself and those of you
who like mathematics like theory, I mean there's a whole world of discovery and a whole world of research
that asks the question
how do you make machines, which are by nature deterministic
they only do what you tell them,
how do you make machine like that
pick a random number
it would seem to be the case that you have to
tell the machine what number to pick
but that would sort of defeat the point of having randomness at all but in fact there
are ways of doing this or there ways of simulating this
and as an aside you can kind of cheat
for instance if your computer has a microphone
well odds are you're not going to be in a perfectly quiet room all the time so maybe you get some
randomness some random noise
by way of turning on your microphone so there's some juicy
areas of discovery there, but for us, we're just going to use it mechanically pick
a random number
from one to ten
this has the effect,
if all goes according to plan, of the following
is that a bug? I clicked and nothing happened
kind of to be expected I think right
okay that time it worked. did, didn't, did.
now as you may recall if we do this an infinite number of times
fifty percent of them will in fact meow, fifty percent of them won't,
and we actually had good statistics. last year it was actually a little awkward because I kept clicking the button
and the damn thing kept meowing meowing meowing
but that actually speaks to the fact that it is in fact random at least in some part.
so who cares? what can we do with this?
well let's see what else we can build on
so there's a way of doing things multiple times now in one of my first programs I had
the cat meow three times
it said play sound meow
wait a second, play it,
wait a second, play it, wait a second
well that's kind of a nice capability if you can tell it to do something multiple times
let me go ahead and open up
this thing here and again this is what we just glanced at the slide
it's rather underwhelming
and in fact
it's perhaps more interesting if we at least make it slightly
by doing it this way with the sound
and in fact all I’ll indulge in what you inevitably will find a fun way procrastinating,
it turns out we don't have to use just the meow, we click things like import,
you find that this environment comes with all these various effects,
so maybe it would be more fun to do something like
then there's the cat
there's other things too, I think if we go into vocals
we can, got this one
so that's not that bad
in terms of annoying,
so then let's do this, so again,
note it, and please stop me, we can't go on this tangent for too long
so there's three tabs up there and again this is not interesting stuff intellectually so we'll wave our
hands at it largely today
but I'm going to go back to my scripts now and now notice, to change the sound
alright so I'll do this
but the point I wanted to make was what do I I do if I want to make it do not six, three
times but six times
well you can duplicate things
so actually let me go ahead and duplicate it from here and I'm just right clicking or control clicking
let me get this stuff out of the way there, and yup
so now I have it on one two three four
five times and actually let me detach this
six seven times, I'm going to drop this over there
and let's just see how much
how annoying this gets
okay so,
so the point is now not to annoy but to demonstrate that this is not the smartest approach to
telling the computer to do something again and again
if you find yourself whether in C, scratch of java script, PHP,
just kind of copying and pasting to get your program to do something
multiple times multiple times which may be compelling
there's got to be another way, and in fact there are these constructs, as we saw with Josh's
example, of looping
in scratch and in C and in java script and in a lot of modern languages
there's these things are called wild loops or for loops
in scratch they're called forever loops or repeat
some number of times
so already can you probably imagine how you might integrate these
well what about something like this? if we wanted to create that very simple effect
of doing something ad nauseam
if we pull up
version six of this
notice that the blocks I've chosen are when green flag clicked
I then grabbed that forever block
and to be clear the forever block is not normally that
tall so notice the mere
act of dragging something like this inside the forever loop
makes it bigger and then if I want to squeeze this in it makes room but again everything
is similarly shaped
now I'm going to have the same effect slightly less annoying,
and now
I've arguably implemented this with a much better design there was no reason for the
copy paste
and in fact if you sort of think about where
that bad habit leads you if you're copying an pasting constantly
imagine how much work it would be for me to go back into the previous version of
that program
and actually
change something like
the sound that's being played I mean my God I have to like change it in six or seven different
drop downs
here I just change it in
one place and so we already have this ability to do things that are
a little better designed. well what about this thing at top right
so top right is saying when green flag is clicked
do the following forever. well what? if touching mouse pointer, play sound meow
and wait two seconds and then repeat alright so let's open this. this is version seven
I'm going to go ahead and open this
and just if you wondered how I was doing it before at the top right there's presentation mode
where you can zoom in and make it even bigger
so now I hit play
nothing seems to be happening but that's consistent with the previous slide because I didn't
use the say block, I didn't use the think block
but notice my mouse, if I move it closer and closer to the cat
it's kind of like petting the cat if you will
clever? I thought so
so kind of interesting let's take things slightly higher so that's version seven let me go
to version eight here
version eight is not that much bigger but now notice what's going to happen you can kind of
see this one coming
alright so this is me thinking I'm really clever
right so let me go ahead and full screen it, click the green flag
and now notice
this is going about his business meowing
and that's all good
if I now try to touch him
bad things happen
and then he'll go back ultimately to meowing. okay so now we have this ability to
do things conditionally
inside of loops
so we seem to have a fairly rich
rich amount of expressiveness we can kind of think about doing something
like I did
last night when putting that together I wanted the cat to just meow meow meow,
and then I wanted to do something optionally so there you have the loop, you have
conditions, sandwich it in between think about what statements you want
and voila, we have that effect
well what more can we do? well we have variables
now variables are useful certainly in the context of Josh where he had to maintain state
he had to remember how many socks he had on
otherwise he would just keep putting on socks putting on socks putting on socks
the use of that variable allowed him to short circuit that loop
and terminate as soon as he reaches some happy place
well what about these two programs here
count one.sv is at left so when green flag is clicked
set a counter that's apparently a variable that I chose, better name than x, a better
name than y, which though you might have used in algebra
really isn't that useful when you trying to remember what your own program does, so again a good matter
of style
is pick variable names that say something interesting
so set counter to zero forever say counter for two seconds
then wait a second
change counter by one, so this is scratch’s approach to ++
all right so in count one.sv
we have the following
count one
no sound but I thought it was clever too that the sheep was doing the counting
haha see geek humor
alright so things are more fun with sounds so we'll kill that thing but that's going to go on up
at least until we hit some upper bound can you anticipate
maybe if you're coming at this with a background in some programming what
could still happen that's bad here?
it might only be using eight bits so ya, actually roll back mentally to Wednesday
when we talked about representing numbers
and by default I kept using eight bits to represent numbers, well if you have eight bits, each one
of which can be a zero or a one
that means you can have two possible values times two here, two two two two two
so that's two to the eighth
right so that meant we had
we had two hundred fifty six
possible values you can represent with eight bits the number zero
then one then two then three then four then five all the way up to two hundred fifty five
and again why two fifty five not two fifty six
computer scientists tend to start counting zero- so we spend one of our encodings that way
so a problem that might arise here is
MIT probably made a judgment call somewhere underneath the hood when they implemented
scratch itself
where they decided you know what
no twelve year old is going to count up to four billion, we don't need thirty two-bit integers
we don't need integers that are represented by thirty two individual bits maybe just eight
or maybe sixteen but they had to make a judgment call
and just as think back to the Y2K problem, what was that problem?
well the world had decided in the 1970s, give or take that
you know this code's never going to be used thirty years from now let's just use two digits
to represent the year
and then we, all you may recall, bad things happened or that things were predicted to
happen certainly expensive things happen
when we roll back from that mistake. So the same thing here
let's I mean let's not spend the time figuring out just how high this sheep
can count
but that too is going to be an issue we trip over when you start coding in C
and in PHP and in Java script when you have much more control over the representation
of numbers and of data
well what about count2.sv here
so when green flag clicked
set number to a random number
say the number
and in if that number's less than six, play sheep
so in English,
in layman's terms, this thing's going to do something fifty percent of the time
but at least now we're going to have some introspection we're going to see why
it's actually playing a sound or not
because it's going to tell me what the number is whereas before I simply had to
guess. So this is count 2
still involving our little cheap here, if I hit play,
nothing happens because six is not less than six, play
ten, still nothing
seven, still nothing
so alright, so this is where we could be tossing a coin, it could keep coming up heads
that many times, hopefully
it will go
the other direction fifty percent of the time so if we get an infinite number of times hopefully
the math would in fact work out
alright so those are variables
well variables are useful but only when you want to store one piece of information
but you could just use then multiple variables to store multiple pieces of information
but if you think now even and terms of scratch, that each variable right now is
its own block
imagine how you might implement, maybe not in a game like
some kind of RPG game where you're a character, ala super Mario brothers and you
have to go around collecting things, any game where, like Zelda, any
or even Halo,
any time you pick up something
and have to add it to your inventory
it would probably be a fairly unmanageable program
if you had to have a separate variable separately named variable
for every
possible possession
that someone in a game might need to carry around it'd be a lot easier if you could sort
of have
just a bucket or a satchel whatever the analog is in the actual game that can contain
zero or more items
and that data structure as we'll start calling it in programming
is what's called an array
sometimes called a vector, also we'll see
fancier versions of this ultimately called
list and trees, but more on that in the time to come
so an array in scratch
gives us this capability we give the array a name
it's called a list
in the context of scratch
and then we can use this block at top
add something to inventory delete
one from inventory, insert thing, a string, at location one of inventory
in other words, and we won't spend too much time on using these now
because you might not need them
but if you find ultimately that you kind of need to keep an arbitrary amount of information
well the data structure you use to make that happen in general
is this thing called an array
well let's see this for real. So this is actually program
that is a role playing game of sorts called, it's called fruit craft
a play on war craft if you're familiar
let me go ahead and full screen this one here
click play
and we have a little animation it seems
right you can move me with the arrow keys
so just as our little DDR game let me move
notice, and actually
so the goal is to look for fruit
so like an idiot I kind of did this the first time
apparently this is a
picture of fruit,
so there's clearly some bugs if you will or at least some disregard for our three-dimensional
world here
I'm going to go around or over or through the table and follow this arrow, I'm just using
my arrow keys right now
all right so okay
there we go, so notice in the top left
scratch is showing me what is inside my list AKA array
now I have cherries, and orange, now this looks interesting, let me
go here, oh, okay so we have
remember some sensing, so remember just as I'm able to sense the sprite touching
my mouse pointer I can also sense a sprite touching another sprite is this person touching
the sign? if so
do something
and even though we might not know all the blocks that we need to make that happen
it's these basic fundamentals, right? an if condition that says if touching
then say and then when not touching don't so, so hide that text
alright so let me go and pick up these things
pineapple bananas
another apple, hopefully this is the right place okay interesting
great job he brought
Cherries, orange, pineapple, bananas, apple
here's your fruit platter
okay so simple but again demonstrates where you might, in a fairly compelling
context actually need some kind of variable amount
of storage
well let's make this more sophisticated still so in this is actually a topic that you can't
traditionally get to
in the first week of a course, let alone an entire semester sometimes
this notion of threading, because a lot of languages whether it's C or java
really don't make it easy
to do what we're about to do and frankly what we've been doing
which is having multiple things happen at once
so the program I wrote earlier that was very underwhelming hello world just printing it
to the screen
that's kind of the only thing it did I could add another printf line another printf line
another printf line
but those are all going to happen in series, not in parallel at the same time
I'm going to get one output one output one output
so what's nice about what's nice about scratch
is that you can have the cat moving you can have a sheep doing something you can have
this guy
this character interacting with the guy behind the counter you have a multi threaded environment
what is a thread
a thread is like a miniature program
that's running inside the context of a larger program
and you can, they can operate
what essentially looks like,
now this is a bit of a white lie because ultimately and we'll talk about this toward the end of
the course
many computers have just one CPU,
central processing unit, the brains of the computer when it says intel inside
means there's an intel CPU inside
well if the computer only has one brain or one CPU, the reality is that computer
can only do something
do one thing at a time
but the neat thing is when you have a gigahertz
so in other words a hertz,
something happening once per second and you can think of there being a clock inside of
your own CPU
so if you have a one gigahertz CPU,
there's a little clock or a little crystal that osculating
one billion times, giga
meaning a billion
one billion times per second
well, my God, if you can do something that fast, clicking your fingers a billion times per
surely we can dupe humans into thinking
that two things are happening simultaneously
so if you've ever run AOL instant messenger in a window and also Microsoft word and a
browser window
and any number of other programs you are multitasking
but realize that you don't have to quit one of those programs to load the other you're
running them all
but what windows is doing what Mac OS is doing
is just giving every one of those programs only a split second
of computation in this CPU, a split second of attention
but because it does it here here here here here then here here here here here where each
of these things is a different program running in your task bar
you the human being the slowest piece of this puzzle
have the illusion of oh, I am running multiple programs at once
those of you with a iphones might be somewhat annoyed these days that apple doesn't support
background applications
or at least written by other people other than apple, in other words you can't
run one program and then use another at the same time if they're written by people in
the App store
and that's because apple has essentially said
users may not run multiple threads simultaneously unless we, apple, implemented those threads
ourselves, unless we wrote the code
now this is partly because the battery life of this thing kind of sucks right now
and if you allowed people to write programs that run in the background
probably the concern they have is that you're going to drain people's batteries and most
people out there don't understand what a thread is and they don't care and they shouldn’t have to care
but that's apples way probably at least in part
of dealing with that issue of multi threading being expensive in terms of battery
so here is a thread
so move 1.sb tells us to do the following when the green flag is clicked
go to x y
so it turns out this whole time that stage
can be modeled in fancy terms as like a Cartesian plane
where you have X coordinates and y
alright, just like in mathematics
so zero zero is pixel location zero zero, the little dot somewhere
on that stage
point in direction ninety degrees so that's either here here here here we'll see once we
orient ourselves
and then forever do the following
if touching the edge
play sound this, this could be interesting
until done, turned 180 degrees, move five steps and then
do it again and again because it's inside the forever loop. so this is move one.sb
so let me go down to this
move one.sb
I'll go ahead and full screen it again
hit play
I don't know if this is like a pedagogical technique or just habit
it seems that if you write programs
that are loud and annoying people remember them, so so be it.
this thing, this is a sprite
notice I've changed his costume, how? well I probably went up here I clicked costumes, I fussed around
with paint or imported a Jpeg or whatever
so uninteresting details intellectually but that you're nonetheless welcome to play with
and procrastinate with for project zero,
but I've made a duck that orients itself ninety degrees and he starts moving
so this notion of walking it's really about moving some number of steps, some number of pixels
and then notice, because I'm doing this again and again and again forever I'm constantly
checking am I touching the edge am I touching the edge, if so,
yell, then turn yourself around
and do it again
so again not a very interactive program but all these simple
puzzle pieces, all these simple building blocks we've been looking at
are really what comprised Anne's DDR like game, Andrew's raining men
and some of the other more sophisticated programs that you'll write
so here's one that actually is multithreaded. that was just one duck
doing his own thing now we'll see a bird and a cat
each of which is a sprite in scratch speak in each of which has its own script
so notice in this program move2.sb
I'm actually going to have
two difference scripts each associated with the difference sprite
so I've highlighted cat at the moment
here's the cat's script, so if I click bird here is the bird's script and they are clearly different
how are they different? well let's look at the cat first
the cat
is doing this
go to negative 160, negative 160, why?
well again I was kind of fussing around one day and I decided let's have a cat start
there specifically trial and error in this case
point in direction
well I wanted this demo to be a little different each time otherwise it's really uninteresting
so pick a random degree between 91 and 179
then forever do the following
if touching bird, here's where it gets fun,
play sound.
that particular sound lion 4 and then stop the script in other words game over is
the implication there, exit, quit.
or actually
I misspoke it's not it an else, it's not an otherwise
but no matter what
point yourself toward the bird and move one step
so in other words if you're touching the bird
play the sound and quit game over
no matter what though, proceed to point toward the bird and move one step
and actually it is implicitly an if else because of the termination so I protract my retraction
so, let's take a look at the bird. what is the bird doing? the bird's not doing all that much
the bird started a hard coded place
and I only did this because it'd be really stupid if the bird might
pseudo randomly start on top of the cat and then that the game has no point
so I go to this location which I know is different from the cat,
point in forty five-degree direction
and then forever
now notice what I did, it turns out with Boolean expressions not only can you check for true
or false you can flip the meaning
so there's a block called not which inverts meaning which is good because I want
to do forever
the following forever if I'm not touching that cat
moved three steps but if I'm on the edge
bounce. We'll also see in scratch
for user friendliness
sometimes they merge the notion of a condition
and a statement like this so if on edge, bounce
just happens to be consolidated into two.
so let's play. I'll go ahead and full screen,
I'll go ahead and click the green flag
and notice
this isn't random, the cat is again
point toward bird
the bird is moving around somewhat randomly
alright so kind of sad but
kind of clever nonetheless at least programmatically
so what
more is there? well what about if we do something
like this, interesting, so this example as we'll see
not only uses multiple threads, multiple scripts happening in lock step
but I'm also using a variable to maintain state
and essentially to communicate across the two sprites, and this is useful if you effectively
want to pass information between the two
so let me go to version 10 of my hai program
that's not in this folder
alright well rather than drag our feet
let's go ahead and do
well you know what we're out of tape anyway let's go ahead and play take a five-minute break
change tapes, and then resume when I've found this file.
version 10 has just gone missing so fortunately we have the source code here
on the left-hand side we have a script a sprite that says forever do the following
if muted equals zero, play sound sea lion
think oh hai for two seconds then wait
then repeat and now notice what the right hand side is doing and this is really the only take
away here giving ourselves a means of communication between sprites
on the right-hand side I have this variable called muted
I set muted to zero, that is false it is not muted is the implication
and then forever do the following, if key space pressed
then check the following if it's muted
set muted to one, else set muted to zero so the right hand side
even though there's a new blocks there
what is that doing in layman's terms the right hand side script?
it's just toddling the state of this variable right? we have a forever loop which
just means forever check the following is the space bar pressed if so,
flip the value of muted
so the goal of this exercise here was again have a little fun playing sound but when I
hit the space bar
it either mutes
or effectively unmutes what?
unmutes the other guy because the other guy because he's also happening in lockstep
whether he's a cat or a bird it really doesn't matter in this case what the sprite is
who's using this script
the left-hand side guy is only going to play the sound sea lion if
that value of muted is zero
so in other words if I hit the space I make him bark
if I hit it again it makes him stop and this just goes on in perpetuity so it's not such
a loss if we haven't that one here, this one's a little more interesting anyway
so I'll go ahead and beat myself up here if you will
this is actually borrowed from a version of this program someone else wrote it wasn't
called David at the time, I took some liberties since I didn't think it'd be the friendliest
thing to have
our students punch him in the face
so I swapped in my own face here
and then think about for just a moment what's probably going on underneath the hood
so I'm apparently moving back and forth as any boxer might
and if I use my arrow keys here I can start punching
and missing
but here we have here actually if we turned this the feature here on notice too
notice my face is clearly changing color. down.
so what's going on? well we don't have to even dissect all the pieces cause for the most part
we've presented all the fundamentals
there's more than just one script now, more than just two there's actually four that belong
to the left glove. it looks like there are as many that belong to the right
my own self has this slightly larger one
but it all boils down if you start to focus on specifics, and again all this code will be online,
it just boils down to do, with making the computer do what you want it to do and each of these
things are sprites therefore they can detect themselves if touching one
sprite do this
and so with these very simple building blocks almost all of which we've rattled off already,
can you do things that are increasingly compelling and much more interesting than just
hello world
well this is one final functionality that's provided by scratch and it's not often found in
at least introductory courses
and this notion of a events,
we'll actually see this in the context of web programming later this semester with java script,
for C we won't really play around with this idea but this example here
simply has two sprites, each of which has one script,
but these guys too can communicate
not by using a single variable so when I discussed a moment ago the notion of muting,
that's what we'll call a global variable, global in the sense that anyone can use or manipulate it,
we'll see that that's not often the best practice
but with events can you do the same thing you can broadcast an event
and the idea is that any other sprite that wants to listen for that event
can somehow respond to it
so in this case here, marco.sb
we have essentially two sprites, playing a game with each other
if I go ahead and play this
we'll see on the left hand side Marco is waiting forever for me to do what
hit the space, so I'll hit the space
and now
the female says polo, so why did she say that? well let's take a look at her, oh,
when I've received event,
say polo for two seconds
so we have cross thread communication inter thread communication
which is useful you know yes to make this simple example happen,
but we offer it for today's purposes as a little
tool for one's tool kit, so to speak
that if you need two sprites to somehow communicate you've got a couple of options, one share a
variable that both of them check the value of and maybe change
or you have events,
which might be a little cleaner than that if you want to send something arbitrary
well it turns out that scratch also supports these things, and in problem set zero
it already is coming in two different editions, standard
and hacker
so the standard edition you'll see when it goes online in PDF form tonight
invites you to pretty much make anything of interest to you so long as it
checks off a few boxes, you need to use at least a variable, you need to have at
least a few different sprites you need to use a sound,
so we laid some basic ground rules just to kind of push you to do more than scratch the
but if you're really the type who wants to get his or her hands dirty very early and
maybe do have more of a
a more comfortable background
there's these things here so these are censor boards that we bought a whole bunch of for students
in the course to use
and they have buttons, they have little sliders that move left to right
they have little inputs that you can connect alligator clips to so that you could check
the resistance
whether through some physical medium like you're yourself left hand and right hand
water, metal, anything like that
there's a light sensor there's an audio censor and so these things too
very simple ideas take a sound, do something with it
you can actually detect it programmatically within the program
so this one is actually a simple example of precisely this, singer.Sb
let me go ahead and open this one here, I'll full screen him
he doesn't do all that much and
he responds to sounds
now he also the responds to this, and now it just looks like I'm talking so it's not terribly
sensitive to different
types of
but we're clearly responding to
still responding to something
a little binary in nature. I wonder how long we can give a lecture like and see how distracting
that is. alright
so this one was
let me go ahead and full screen this one
we need to raise the house lights again
can we bring them down again
so it is in fact a light sensor
and the game gets a little freaky when the lights go down so that was actually unintentional the
first time, normally I use my hand but taking down Sander's Theatre's lights
also works as well there
well we have one other here so this one was particularly sophisticated but again speaks
to the relative complexity you can create with what is ultimately quite simple building
this is one by David Woo
now a junior. I'm going to click green flag here
this one uses the little censor bar
to move this guy back and forth
and the goal is I think to get the bananas and not get hit by these
oh the monkey’s stun counter has just gone up
which means that for like 174 milliseconds or whatever I'm stunned
and he's not responding now notices his eyes that's bad
okay so that actually uses the slider back and forth but this one actually has some
notion of a friction coefficient
so it's not just going left and right in response to me, he kind of skids out on what is ultimately
supposed to be ice, so again
very simple primitives, right? Light on light off sound on sound off slider left lighter right
but even scratch can interface with this so realize that for problem set zero
the hacker edition is by nature meant to be very
very accessible and we have over one hundred or two hundred of these things at in the hall
that you will be able to collect today
and at any office hours next week
for problem set zero
so this is this program now that I promised, this is the first thing that I wrote and this
was one of those
either sad or really impressive stories of a late Friday night eight hours straight
playing this, you'll see here in a moment
that's I chose a song that is perhaps the most annoying song in the world to play
ad nauseum for eight hours while you debug
your own program
but this is a little something called Oscar time
and it's source code too will be distributed on the course's web site
just so that you can see a lot of different interactions going on
so I stole this actually from an old piece of software from Mac OS so
back when I was a kid growing up with like a Macintosh SE
there was this plug in called
and you could install it and then any time you dragged trash to your trash can
Oscar would pop out sing a little song and then go back in, right? so completely amusing
for like the first few weeks first few months and then you realize this is just a
it's a slippery slope
so let me go ahead and play this
perhaps not in its entirety lest you never again be able to watch sesame street
but as the instructions say, drag as much falling trash as you can to Oscar's trash
so notice this game too,
is going to interact with my keyboard, this is trash
and I won't go too far but notice if I pull it into the trash quickly
the trash reappears and I notice it's appearing in a different place each time
so even this game
is using some pseudo randomness
and what we'll see is that this gets progressively
faster and progressively faster much like the DDR game before
I thought a fun
note perhaps to conclude on is this
throughout today we've been dragging and dropping puzzle pieces, it's a very intuitive
language problem set zero will task you with precisely that, implementing the program
that most amuses you
we spoke of cell phones earlier today albeit in the context of iphones
yes it is the case if you read this morning's Crimson, that Google very kindly donated
some twenty telephones to CS50 and CS1
so that we could and empower some of you
if you so desire at terms end to implement any final product that you want but also want
if you so choose
on what's called an android cell phone marketed by t-mobile and some other folks throughout
the world
well we read this article the crimson has always been very good to us in recent years
press wise, we were
quite flattered that they took an interest in this project
but we were also quite amused and within minutes of this article going on-line, it's on the front
page of today's crimson
I got this note here whose names and such have been redacted
let's be clear
this is the email I got,
so then I got a little curious so I'm like okay
interesting there's an article here about CS50, so thecrimson.com
okay yup we are in fact on the front page there as well as in the print version
so what you
hopefully realize today
paragraph two look for it
so bless their hearts, right?
this is in fact dragon drop programming that you will be focusing on
for problem set zero, but I did think in fairness, because again we're big fans and
frankly a lot of our team members are on the crimson so it's all good, I did think that
I could at least makes this so, so instead of Oscar time which drops this trash
I want to head in decided we could do this you know so I'm going to go to the trash here
so a little on the fly programming note in a different costume here
and I’m going to click import
I kind of prepared in advance here, I'm going to go to my desktop folder I’m going to go into
my zero folder where I hid it,
I've got a little costume here
so did you will, let me go to this thing here
I'm going to go ahead and click this button to shrink him down a little bit
you have the ability to rotate sprites as you'll see, I'm going to tell it not to rotate anymore
and now if we can crank the volume up just a little bit
we have for you in conclusion today
dragon drop
we'll see you on Wednesday