230 likes | 324 Views
Programming Class. Logo Programming Fall 2011 – Session 7. Teacher: M. Taghizadeh Sobhan Highschool. Pen Up, Pen Down. So far, all of our drawings have had two limitations. First, they are entirely made up of lines (no solid shapes). Second, all of the lines are connected.
E N D
Programming Class Logo Programming Fall 2011 – Session 7 Teacher: M. Taghizadeh Sobhan Highschool
Pen Up, Pen Down So far, all of our drawings have had two limitations. First, they are entirely made up of lines (no solid shapes). Second, all of the lines are connected. In this lesson, we will overcome these limitations. We will learn how to move the turtle without drawing a line. We will also learn how to fill in the outline of a shape with a solid color.
Pen Up, Pen Down • PU PEN UP • PD PEN DOWN
Pen Up, Pen Down Draw a dashed line
Pen Up, Pen Down Draw a dashed line • REPEAT 10 [ • FD 5 • PU • FD 5 • PD • ]
Pen Up, Pen Down Draw a dashed line in function 1 • To dash :length • REPEAT :length/10 [ • FD 5 PU FD 5 PD • ] • End • Dash 300
Pen Up, Pen Down Draw a dashed line in function 2 • To dash :length :size • REPEAT int(:length/(:size*2)) [ • FD :size PU FD :size PD • ] • End • Dash 300 8
Pen Up, Pen Down INT Function • Repeat 10 [ ... ] • Repeat 20 [ ... ] • Repeat 17 [ ... ] • Repeat integer [ ... ]
Pen Up, Pen Down INT Function • Int ( number ) integer of number • Int (17.7) 17 • Int (13.33333) 13 • Int (758.254) 758
Pen Up, Pen Down Draw a dashed line in function 3 • To dash :length :size1 :size2 • REPEAT int(:length/(:size1+:size2)) [ • FD :size1 PU FD :size2 PD • ] • End • Dash 300 5 10
Pen Up, Pen Down Draw a dashed rectangle • To dash :length :size • REPEAT int(:length/:size*2) [ • FD :size PU FD :size PD • ] • End • repeat 4 [dash 300 10 rt 90]
Pen Up, Pen Down Draw a series of rectangles 50 10
Pen Up, Pen Down Draw a series of rectangles • TO SQUARE :LENGTH • REPEAT 4 [ FD :LENGTH RT 90 ] • END • To rect_series • repeat 5 [ • square 50 • pu • rt 90 fd 60 lt 90 • pd • ] • end
Pen Up, Pen Down Draw a series of circles 50 10
Pen Up, Pen Down Draw a series of circles • To circles_series • repeat 5 [ • circle 50 • pu • rt 90 fd 110 lt 90 • pd • ] • end
Pen Up, Pen Down Draw a series of rectangles 60 100
Pen Up, Pen Down Draw a series of rectangles
Pen Up, Pen Down Draw a series of circles
Pen Up, Pen Down Draw a series of circles
Pen Up, Pen Down Draw a series of 6-edges HIVE
Procedure Saving Drawings • Bitmap • Save As
Procedure Change Pen Color, Pen Size, Color Screen • Set • Pen Size • Pen Color • Screen Color
The End Logo Programming Fall 2011 – Session 7 Teacher: M. Taghizadeh Sobhan Highschool