Intro to Turtle Graphics (Part 2)

Slides:



Advertisements
Similar presentations
The Peanut Butter & Jelly Computer Instructor’s Handout (modified from zerorobotics and CS10K Community handouts) KEY CONCEPTS Software and hardware work.
Advertisements

Making a “P and J” sandwich
How to Make a Peanut Butter and Jelly Sandwich Mrs. Broesamle and Mrs. Pelkey.
How to make a peanut butter and jelly sandwich
Making a Peanut Butter and Jelly Sandwich
Presented by: Clare McGrath Project #5: How to Make a Peanut Butter and Jelly Sandwich May 4, 2011.
Peanut Butter and Jelly Sandwich Ingredients Peanut butterTwo slices of bread Jelly or jamKnifePlate.
How to Make a Peanut Butter and Jelly Sandwich By Kristy and Jon.
How to Make a Peanut Butter and Jelly Sandwich
Lauren O’Malley May 11,  Purpose: To teach the art of mastering the Peanut Butter & Jelly sandwich.  Audience: The audience includes people 8.
How to Make a Peanut Butter and Jelly Sandwich
How to Make a Peanut Butter and Jelly Sandwich Presented by: Lizzy Trillo Project 5: How to Make a PB & J Sandwich 5/3/11.
A Social Story and Activity Click on the words to hear them spoken.
 When using the rotary cutter always walk with the blade closed. To open the blade place four fingers around the handle and slide the blade guard button.
By Droids Robotics Good Coding Practices: Start with Pseudocode BEGINNER EV3 PROGRAMMING LESSON © 2015 EV3Lessons.com, Last edit 4/1/
Intro to Robots Robots are Everywhere. Intro to Robots Various robots in use today lawnmower pet baby seal for convalescents gutter cleaner home security.
Programming in Python Turtle Graphics Dr. Kristine Nagel Genie Yang Raquel Lawrence Dr. Kristine Nagel Genie Yang Raquel Lawrence Georgia Gwinnett College.
Fitness Circuit Mrs. Harmer
Alice Learning to program: Part Two by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
How to Make a Peanut Butter and Jelly Sandwich Presented by: Christopher DiFabio Project 5: How to Make a PB & J Sandwich May 21, 2012.
By Ella Marks n/ImageDisplay/1/18/10 Clipart.
StarLogoTNG Treasure Hunt Game Unit Lesson 1: Basic Movement.
By: Rachel Kenney. First Step Get a plate and bread out.
Module 6 Lesson 16.
Explanation of Web 6, Web 7 and Web 9 at my site Please be sure to bring up the speaker notes for the explanation Intro - Web 6, Web 7 and Web 9.
Dining Etiquette Jeopardy.
9.7 Dependent and Independent Events Mr. Swaner. Notes Independent events are not influenced by any other event. That is, the event does not depend on.
How to make a Peanut Butter and Jelly Sandwich!
Computer Bugs Original Powerpoint By: Spring LIS4480 Coding Team Jon.
Karel J Robot An introduction to BlueJ and Object- Oriented Programming.
Georgia Institute of Technology Barb Ericson Georgia Institute of Technology May 2006 Teaching Java using Turtles part 2.
Art 321 Lecture 7 Dr. J. Parker. Programming In order to ‘make things happen’ on a computer, you really have to program it. Programming is not hard and.
Moving Around in Scratch The Basics… -You do want to have Scratch open as you will be creating a program. -Follow the instructions and if you have questions.
CONTROL SYSTEMS Control Systems A command is a directive that performs a specific task An argument is a variable that can be used by the function reveiving.
Java Introduction part 2 CSC1401. Overview In this session, we are going to examine some of the instructions from the previous class in more detail.
Loops & Graphics IP 10 Mr. Mellesmoen Recall Earlier we wrote a program listing numbers from 1 – 24 i=1 start: TextWindow.WriteLine(i) i=i+1 If.
PowerPoint Basics Tutorial 3: Graphics In this tutorial we’ll be looking at graphics, and the various types of illustrations that can be included in a.
How to Make a Peanut Butter and Jelly Sandwich Presented by: Andrew Stockmoe Project 5: How to Make a PB & J Sandwich 5/3/12.
How to Make the Perfect PB&J By: Jade Edwards. Materials Needed: ➾ 2 slices of white bread ➾ 1 jar of peanut butter ➾ 1 jar of grape jelly ➾ 1 paper plate.
Presented by: Mr. Pugh’s Class 2011 Ingredients Peanut Butter Jelly Two Slices of Bread.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Turtle Graphics Let’s see what we can draw on Python!
How to Make a Peanut Butter and Jelly Sandwich Presented By: Robby Kelly Project 5 How to Make a Peanut Butter and Jelly Sandwich 12/2/10.
LOGO WHAT IS IT? HOW TO USE IT AND HOW USEFUL CAN IT BE?
What is it? How to use it and how useful can it be?
Introducing the turtle
Informational Writing (Procedural) ELACC5W2: Write informative/explanatory texts to examine a topic and convey ideas and information clearly. EQ: How can.
How to make a pb and j sandwich Presented by: Collin Neale Project 5.
Task Analysis of a Ham, Cheese and Tomato Sandwich
Let’s see what we can draw on Python!
Formatting Output.
Copyright © 2008 by Helene G. Kershner
Copyright © 2008 by Helene G. Kershner
Introduction to Flowcharts
BEGINNER PROGRAMMING LESSON
Making a PBJ Sandwich Less Mess, No Stress
The procedure.
Solving the Rubik’s® 2x2 Cube
Teaching Java using Turtles part 2
How to make a peanut butter & jelly sandwich
BEGINNER PROGRAMMING LESSON
SCIENCE ON FRIDAYS.
How to Make a Peanut Butter and Jelly Sandwich
Reading class Making a Sandwich.
Objective Given this activity, the students will be able to make the perfect peanut butter and jelly sandwich by following the steps in order.
BEGINNER PROGRAMMING LESSON
For this test you will be asked to remember the colors of words that are briefly presented on the computer screen. After several have been presented you.
Developing A Good Procedure
Solving the Rubik’s® 2x2 Cube
Instructional Focus Lesson Plan Reading 2.3 Grade 1
Presentation transcript:

Intro to Turtle Graphics (Part 2) Let’s continue to draw on Python …

Review: Peanut Butter Jelly Time! Remember this guy …

Review: Peanut Butter Jelly Time! Recall that in the beginning of the year we learned that software is basically a set of instructions for your computer Remember, computers may be powerful but they’re really not all that smart! We’ve learned that we need to be very precise in our instructions as computers are very obedient, but they won’t think for themselves.

Review: Peanut Butter Jelly Time! Well, let’s look at some of the “software” we created before practicing programming … Example 1: Walk to the kitchen. Walk towards the cabinets. Take a plate out of the cabinet. Walk towards the counter that has the bread. Put a slice of bread on your plate. Walk towards the toaster. Put the bread in the toaster.

Review: Peanut Butter Jelly Time! Toast the bread. Walk to the refrigerator. Take out the peanut butter and Nutella jars. Walk towards the utensil drawer. Take out two butter knives. Open the jars. Use one knife for peanut butter and spread peanut butter on one side of the toast.

Review: Peanut Butter Jelly Time! Example 2: Get the peanut butter and jelly. Get two slices of bread. Open the peanut butter. Take some of the peanut butter and spread it. Then, take some jelly and spread it. Put bread together and eat.

Review: Peanut Butter Jelly Time! Now that we’ve had some practice with programming and we understand just how specific we need to be, let’s try this again! Write out a set of instructions for your robot at home that will allow it to successfully make a peanut butter and jelly sandwich. This does not necessarily mean your program needs to be longggg and include every minute detail, we just need to be sure to include all steps (concise, is nice!)

Review: Peanut Butter Jelly Time! Example 3: Hello. First walk into the kitchen. Walk towards the pantry. Grasp the handle. Pull outwards until pantry is open. Reach into the pantry and grasp the peanut butter jar. Retract your arms backward. Turn 90 degrees. Walk towards counter and place jar on counter by removing your grasp of the jar. Walk towards the pantry and grasp the bag of bread with one hand. With the other grab the jar of jelly. Retract both hands inward, turn 90 degrees, and walk back towards the counter. Place the bread and the jelly on the counter. Walk towards pantry again just as before and remove a plate and a knife and spoon. Carry the spoon and knife in one hand and the plate with the other. Close the pantry. Take the plate, spoon, and knife back to counter and place on counter. Take hold of the top of the peanut butter jar. Turn your hands until top removes itself. Place top on counter. Take hold of the top of the jelly jar. Turn your hands until top removes itself. Grab bag of bread and undo twisty-tie. Remove twisty tie. Open bag of bread. Grab two slices of bread. Remove two slices of bread and place on plate. Close bag of bread. Take hold of the knife and position your hand above the jar of peanut butter. Lower the knife into the jar of peanut butter. Turn the knife as it’s in the peanut butter to get some on the knife. Remove the knife gently from the jar and bring knife over to either slice of bread on the plate. Lower the knife with peanut butter onto the bread and slide back and forth until it is covered with peanut butter. Place knife on the plate. Grab hold of the spoon and position it over the jar of jelly. Lower the spoon into the jar and scoop up some jelly. Remove spoon from jar and bring spoon over to the other slice of bread. Dump the jelly from the spoon onto the bread and spread back and forth. Now, take hold of the slice of bread with peanut butter and pick it up on the sides so as to not touch the peanut butter. Turn it over (180 degrees) and place it on top of the piece of bread with jelly so as the shapes match. Eat.

Review: Peanut Butter Jelly Time! In addition, create at least TWO functions, for activity that we might see ourselves repeating throughout the process. Example:

Review: Peanut Butter Jelly Time! In addition, create at least TWO functions, for activity that we might see ourselves repeating throughout the process. Example: def spread(type): - pick up knife - dip in type of jar - scoop some spread out of jar - place knife with spread facing bread at top right corner on blank side of bread - evenly spread throughout one side of bread

Review: Basic Turtle Functions Okay, now let’s get back to Python Remember, we learned a few instructions that turtle understands in Python: turtle.forward(spaces) turtle.right(degrees) turtle.left(degrees) Note that we have both a function for turning left AND turning right, but maybe this wasn’t always the case …

Meet Karel This is Karel … Karel was a programming language created to help beginners understand the precision of instructions necessary when programming a computer. Unfortunately, Karel only knows two directional commands: >> move – moves forward one coordinate >> turnLeft – turns left 90 degrees

Meet Karel So, how the heck does Karel turn right?

Meet Karel The Karel language also allows for users to create functions, which is where the turnRight function comes from def turnRight(): turnLeft()

Review: Basic Turtle Functions We learned a few more: turtle.goto( x_coor, y_coor ) turtle.penup() turtle.pendown() Remember that whenever you pick the pen up, you need to put it back down if you want to begin drawing again. Also, by default, turtle will begin drawing when first starting a program. In other words, you do not need to begin by calling turtle.pendown()

Review: Basic Turtle Functions We also briefly took a look at this function: turtle.speed(level) This function takes one float argument, denoting the speed at which the turtle draws. You can pass arguments as large as you want but at a certain point, turtle will be moving as quick as it can. Give it a break … It seems you can pass an argument as long as it is greater than 0.5. Any argument less than or equal to 0.5 will just cause turtle to fly through your instructions.

Pen Color By default, turtle will draw solid black lines However, you can change the color of your lines by calling the function: turtle.pencolor(“color_code”) This function accepts one argument, which is the color code. Note: the color code must be inside of delimiters!

RGB Color The color value can be a standard Red Green Blue (RGB) color code. # this is to set the color as red turtle.pencolor(“#FF 00 00”) # this is to set the color green turtle.pencolor(“#00 FF 00”) # this is set the color blue turtle.pencolor(“#00 00 FF”)

RGB Color RGB color codes define how much red, green and blue should be mixed into a given color They are divided into three channels: - the first two characters denote the amount of red - the second two characters denote the amount of green the third two characters denote the amount of blue Color code: “ # 00 00 00 ”  this would be black Note that they do not need to be spaced out Note also that most color codes begin with a # symbol

RGB Color RGB uses a number system called “hexadecimal” Hexadecimal (or “hex”) is a base 16 number system. This means it uses 16 digits to represent numbers Counting in hex: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F You’ll notice that here the 11th to 16th digits are represented by letters

RGB Color #000000  this denotes black #FFFFFF  this denotes white #FF0000  this denotes all red #00FF00  this denotes all green #0000FF  this denotes all blue

RGB Color Resources Web based color tools/websites: http://cloford.com/resources/colours/500col.htm http://paletton.com/#uid=14r0u0kllllaFw0g0qFqFg0w0aF

Programming Challenge: RGB Squares Draw three squares in different colors. One in red, one in green and one in blue.

Fill Shape Command We can also fill in our shapes with colors: turtle.fillcolor(“color_code”) turtle.begin_fill() turtle.end_fill()