Presentation is loading. Please wait.

Presentation is loading. Please wait.

For loops. turtle drawings – common core state standards 1.1 Innovate: Demonstrate creative thinking, construct knowledge and develop innovative products.

Similar presentations


Presentation on theme: "For loops. turtle drawings – common core state standards 1.1 Innovate: Demonstrate creative thinking, construct knowledge and develop innovative products."— Presentation transcript:

1 for loops

2 turtle drawings – common core state standards 1.1 Innovate: Demonstrate creative thinking, construct knowledge and develop innovative products and processes using technology. 1.3 Investigate and Think Critically: Research, manage and evaluate information and solve problems using digital tools and resources 2.4 Adapt to Change (Technology Fluency): Transfer current knowledge to new and emerging technologies L.11-12.3. Apply knowledge of language to understand how language functions in different contexts, to make effective choices for meaning or style, and to comprehend more fully when reading or listening. RI.11-12.1. Cite strong and thorough textual evidence to support analysis of what the text says explicitly as well as inferences drawn from the text, including determining where the text leaves matters uncertain 9-12 APPD The ability to solve problems is greatly enhanced by use of mathematics and information technologies 9-12 INQF Communicate Science is a human endeavor that involves logical reasoning and creativity and entails the testing, revision, and occasional discarding of theories as new evidence comes to light. S-CP.9. Use permutations and combinations to compute probabilities of compound events and solve problems. N-Q.1. Use units as a way to understand problems and to guide the solution of multi-step problems; choose and interpret units consistently in formulas; choose and interpret the scale and the origin in graphs and data displays. Educational Technology Language Reading Science Math

3 turtle drawings - learning targets o I will be able to create geometric designs o I will be able to assign appropriate coordinates o I will be able to assign appropriate angles

4 review NO PHONE NEEDED o write the code to draw a square using turtle->forward() and turtle- >left turn()

5 turtle drawings o move the turtle to create cool drawings! o demo: https://www.touchdevelop.com/rate https://www.touchdevelop.com/rate (handout - page 15-21) step 1 step 2

6 turtle drawings – short answers o turn to your elbow partner on left o paper exercise – answer questions which part of code is responsible for making sides longer? which part of the code is responsible for angling squares? which line of code is responsible for changing the color every layer of the spiral?

7 turtle drawings – free form o turn to your elbow partner o complete these coding challenges: can you code these geometric shapes? 123 4

8 paper exercise NO PHONE NEEDED o write the code to draw two ‘I’ s using o Forward (F) o Back (B) o Left Turn (LT) o Pen Up (PU) o Pen Down (PD) Vocabulary

9 exercise NO PHONE NEEDED o write the code to draw two ‘I’ s using o turtle->forward(F100) o turtle->left turn(LT 90) o turtle->pen up() turtle->forward(F100) turtle->left turn(LT 90) turtle->pen down() turtle->forward(F100)

10 review NO PHONE NEEDED o write the code to draw a square using turtle->forward() and turtle- >left turn() o circle the lines of code that get repeated

11 paper exercise NO PHONE NEEDED o write the code to draw a square using turtle->forward() and turtle- >left turn() o circle the lines of code that get repeated

12 for loops o for: repeat the same code many times definition |for 0 ≤ i < n do ||dosomething() this code runs n times watch the indentation!

13 exercise NO PHONE NEEDED o fill the code below to draw a square for 0 ≤ i forward(_____) turtle->left turn(_____) o give one reason why the for loop is useful

14 exercise ON PHONE o draw a triangle o draw a pentagon o draw a dodecagon o draw a circle tip: use turtle->set speed(0) to disable animations

15 loop variable o for: repeat the same code many times for 0 ≤ i post to wall i is the loop variable. It takes the value of 0, 1, 2 … to n-1. i can be used within the for loop

16 experiment o change your turtle program as follows for 0 ≤ i forward(100 + i * 10 ) … o what shape does the turtle draw? What happens when you multiply i with negative 10?

17 exercise o create a turtle script that a square spiral using a for and loop variable

18 colors o at every iteration, change the color of the turtle var c := colors→random turtle→set pen color(c) o create gradient effects, var c := colors→linear gradient( colors→red, colors →blue, i / sides)

19 o recreate the drawing at the right. Try doing it in the following steps: o 1. Don’t worry about color. o 2. Make your drawing gradually change colors. o 3. Try using two layers of four loops, one inside the other. challenge


Download ppt "For loops. turtle drawings – common core state standards 1.1 Innovate: Demonstrate creative thinking, construct knowledge and develop innovative products."

Similar presentations


Ads by Google