Presentation is loading. Please wait.

Presentation is loading. Please wait.

Looping and Random Numbers

Similar presentations


Presentation on theme: "Looping and Random Numbers"— Presentation transcript:

1 Looping and Random Numbers
UNIT 3 – LESSON 9 Looping and Random Numbers

2 VOCABULARY Loop: a programming construct that repeats a group of commands. Iteration: "loop" by another name - the repetition of a statement, process, or procedure. For Loop - A particular kind of looping construct provided in many languages. Typically, a for loop defines a counting variable that is checked and incremented on each iteration in order to loop a specific number of times.

3 You will learn to use random values and looping to create variation in their drawings and quickly duplicate objects you wish to appear in your digital scenes many times

4 Loops are a relatively straightforward idea in programming - you want a certain chunk of code to run repeatedly - but it takes a little practice to get good at controlling loops and recognizing how and where in your programs to use them.

5 Random numbers are also used more (much more) in this lesson as an effective way to experiment with loops. 

6 As we have developed as programmers, we have focused on the process of breaking down large tasks into smaller pieces and assigning each piece a function.

7 When we break down a large task, often we will find that some portion of the task needs to be repeated many times. As programmers, we would simply call the same function many times. This might work if we need to call the same function five times, but if that function needs to be run 1,000,000 times, we’ll need a better solution.

8 Today we’ll be exploring how a programming construct called a loop solves this problem by allowing us to repeat a set of commands many times.

9 We’ll also practice looping through commands many times with random input, therefore giving us many instances of random output.

10 Open up Code Studio Watch video work through Lesson 9!

11 I will check you at: 6 – run at least 1500 times 7 - > 2500 times, 2 loops, not nested (not optional!) graded in Code Studio HW – finish the lesson, clean and green


Download ppt "Looping and Random Numbers"

Similar presentations


Ads by Google