1 00:00:00,000 --> 00:00:00,690 2 00:00:00,690 --> 00:00:02,620 >> DAVID MALAN: Let's improve the design of this program. 3 00:00:02,620 --> 00:00:06,090 Rather than continue to copy and paste, or duplicate coughs, let's 4 00:00:06,090 --> 00:00:09,730 instead leverage that construct we called a loop so as to do the same 5 00:00:09,730 --> 00:00:11,500 thing again and again. 6 00:00:11,500 --> 00:00:14,340 >> Let's first drag some of these pieces out of our way. 7 00:00:14,340 --> 00:00:18,640 Let's grab a repeat block, and let's change that default 10 to just 3. 8 00:00:18,640 --> 00:00:23,320 Now let me steal just one pair of this triple of pairs, plug that into our 9 00:00:23,320 --> 00:00:25,830 loop, throw these other pieces away altogether. 10 00:00:25,830 --> 00:00:29,080 And we've now whittled this program down into something much simpler yet 11 00:00:29,080 --> 00:00:31,720 just as readable and just as functional. 12 00:00:31,720 --> 00:00:36,670 Indeed, let's click the green flag, and we get a cough, a second cough, 13 00:00:36,670 --> 00:00:39,230 and a third cough. 14 00:00:39,230 --> 00:00:40,480 Better, right? 15 00:00:40,480 --> 00:00:42,050