>> SPEAKER: Suppose Scratches come down with bit of a cold,
and he keeps coughing.
Let's begin to implement that program.
When green fly clicked, let's have Scratch say, not hello, but cough for
one second. .
And let's start there.
Green flag, single cough .
He's a bit more under the weather than that, though, so let's have him cough
a few times.
>> But let's have him pause a little bit to catch his breath in between each.
So let's wait one second after that.
And now let's go back to looks, drag another say block.
This time again saying, cough for one second.
And let's again grab wait one second.
Now let's click the green flag.
>> Two coughs.
Some time passes, though, and he's still not doing so well.
And the next time this happens, he's going to cough three times.
Well, rather than dragging and dropping and dragging and dropping the
same puzzle pieces again and again, Scratch actually let's me duplicate
puzzle pieces by clicking with my right mouse button or with Control
clicked on my keyboard, duplicate, so I can paste that right into place.
>> So now, I have a sequence of three coughs, and maybe more if I continue
that pattern.
Cough, cough, cough.
Now, the fact that I was getting bored dragging and dropping, or duplicating
the same puzzle pieces should have been a cue to me that I'm probably not
implementing this program with the best design.
>> Any time you resort to dragging and dropping the same puzzle pieces again
and again, or copying and pasting your own code, indeed, you could probably
be implementing this program more elegantly.
In fact, haven't we seen a construct before that would let us do something
again, and again, and again?