1 00:00:00,000 --> 00:00:00,490 2 00:00:00,490 --> 00:00:02,570 >> SPEAKER: Suppose Scratches come down with bit of a cold, 3 00:00:02,570 --> 00:00:03,800 and he keeps coughing. 4 00:00:03,800 --> 00:00:06,140 Let's begin to implement that program. 5 00:00:06,140 --> 00:00:13,140 When green fly clicked, let's have Scratch say, not hello, but cough for 6 00:00:13,140 --> 00:00:15,040 one second. . 7 00:00:15,040 --> 00:00:16,400 And let's start there. 8 00:00:16,400 --> 00:00:18,970 Green flag, single cough . 9 00:00:18,970 --> 00:00:21,700 He's a bit more under the weather than that, though, so let's have him cough 10 00:00:21,700 --> 00:00:22,560 a few times. 11 00:00:22,560 --> 00:00:25,740 >> But let's have him pause a little bit to catch his breath in between each. 12 00:00:25,740 --> 00:00:27,920 So let's wait one second after that. 13 00:00:27,920 --> 00:00:31,340 And now let's go back to looks, drag another say block. 14 00:00:31,340 --> 00:00:34,650 This time again saying, cough for one second. 15 00:00:34,650 --> 00:00:37,310 And let's again grab wait one second. 16 00:00:37,310 --> 00:00:38,560 Now let's click the green flag. 17 00:00:38,560 --> 00:00:41,820 18 00:00:41,820 --> 00:00:42,930 >> Two coughs. 19 00:00:42,930 --> 00:00:45,150 Some time passes, though, and he's still not doing so well. 20 00:00:45,150 --> 00:00:47,900 And the next time this happens, he's going to cough three times. 21 00:00:47,900 --> 00:00:50,270 Well, rather than dragging and dropping and dragging and dropping the 22 00:00:50,270 --> 00:00:53,410 same puzzle pieces again and again, Scratch actually let's me duplicate 23 00:00:53,410 --> 00:00:57,250 puzzle pieces by clicking with my right mouse button or with Control 24 00:00:57,250 --> 00:01:02,220 clicked on my keyboard, duplicate, so I can paste that right into place. 25 00:01:02,220 --> 00:01:05,170 >> So now, I have a sequence of three coughs, and maybe more if I continue 26 00:01:05,170 --> 00:01:06,440 that pattern. 27 00:01:06,440 --> 00:01:11,000 Cough, cough, cough. 28 00:01:11,000 --> 00:01:14,220 Now, the fact that I was getting bored dragging and dropping, or duplicating 29 00:01:14,220 --> 00:01:18,410 the same puzzle pieces should have been a cue to me that I'm probably not 30 00:01:18,410 --> 00:01:20,910 implementing this program with the best design. 31 00:01:20,910 --> 00:01:24,320 >> Any time you resort to dragging and dropping the same puzzle pieces again 32 00:01:24,320 --> 00:01:27,910 and again, or copying and pasting your own code, indeed, you could probably 33 00:01:27,910 --> 00:01:30,500 be implementing this program more elegantly. 34 00:01:30,500 --> 00:01:33,930 In fact, haven't we seen a construct before that would let us do something 35 00:01:33,930 --> 00:01:35,700 again, and again, and again? 36 00:01:35,700 --> 00:01:37,477