Institute for Entrepreneurship and Career Development IECD Logo

  • Slides: 35
Download presentation
Institute for Entrepreneurship and Career Development (IECD) Logo Program Theory & Practicals K. Muthuramalingam

Institute for Entrepreneurship and Career Development (IECD) Logo Program Theory & Practicals K. Muthuramalingam Assistant Professor csbdu. in

The simple Logo drawing commands move the turtle forward and backward and turn it

The simple Logo drawing commands move the turtle forward and backward and turn it right or left. The commands and their abbreviations are given below: FD forward BK backward RT right turn LT left turn CS clear screen CT clear text PU Pen up PD pen down HT turtle disappears ST turtle appears

Sample movement of Turtle FD 50 RT 90

Sample movement of Turtle FD 50 RT 90

PU "pen up, " it lifts the "pen" from the screen so that moving

PU "pen up, " it lifts the "pen" from the screen so that moving the turtle doesn't draw a line. Example: PU PD Puts the pen down so that moving the turtle draws a line. Example: PD Set. Pen. Size [n n] Sets the width of the pen to n pixels. Note that it is necessary to put in two numbers. Example: Set. Pen. Size [5 5] SETPC 5 FD 50 Setpensize [5 5] SETPC 8 FD 50 Pennormal Sets the pen back to normal mode

repeat 360[fd 1 rt 1] rt 90 fd 20 setfc [255 0 0] fill

repeat 360[fd 1 rt 1] rt 90 fd 20 setfc [255 0 0] fill setfloodcolor [r g b] Sets the flood color to the appropriate RGB (Red, Green, Blue) values, where r, g, and b are numbers that range from 0 to 255. Example: setfloodcolor [255 0 255] (Gives magenta) fill Floods the area bounded by lines with whatever color was specified in the setfloodcolor command. Example: fill

 • HT/ST (HIDETURTLE/SHOWTURTLE) HT turtle disappears, but can still draw ST turtle appears

• HT/ST (HIDETURTLE/SHOWTURTLE) HT turtle disappears, but can still draw ST turtle appears on screen

setpos [x y] Sets the absolute x and position of the turtle. If the

setpos [x y] Sets the absolute x and position of the turtle. If the pen is down, it will draw a line from it's previous position. Example: setpos [100 90] Sets the turtle x=100 and y=90.

ARC a r Draw an arc with an included angle of a degrees and

ARC a r Draw an arc with an included angle of a degrees and radius of r. However, the turtle remains at the center of the arc. Example: ARC 45 100 ARC 2 a r Draw an arc with an included angle of a degrees and radius of r. However, the turtle ends up at the end of the arc. Example: ARC 45 100 Show XCOR , SHOW YCOR arc 45 100 arc 90 100 arc 180 100

Animation in Logo REPEAT 12 [REPEAT 4 [FD 100 RT 90] RT 30] REPEAT

Animation in Logo REPEAT 12 [REPEAT 4 [FD 100 RT 90] RT 30] REPEAT 6 [FD 100 REPEAT 6 [FD 10 BK 10 RT 60]BK 100 RT 60]

REPEAT 6 [FD 100 REPEAT 60 [FD 20 BK 20 RT 6]RT 60] REPEAT

REPEAT 6 [FD 100 REPEAT 60 [FD 20 BK 20 RT 6]RT 60] REPEAT 8 [RT 45 REPEAT 6 [REPEAT 90 [FD 2 RT 2] RT 90]]

fd 50 bk 50 rt 90 fd 50 repeat 6 [fd 50 bk 50

fd 50 bk 50 rt 90 fd 50 repeat 6 [fd 50 bk 50 rt 90 fd 50 lt 90]

repeat 40 [ wait 30 fd 100 bk 100 rt 10 fd 100 bk

repeat 40 [ wait 30 fd 100 bk 100 rt 10 fd 100 bk 100]

PERSPECTIVE repeat 18 [ellipse 100 200 rightroll 10]

PERSPECTIVE repeat 18 [ellipse 100 200 rightroll 10]

 repeat 2 [ wait 20 rt 45 wait 20 fd 200 wait 20

repeat 2 [ wait 20 rt 45 wait 20 fd 200 wait 20 rt 45 wait 20 fd 100 wait 20 rt 90] PERSPECTIVE REPEAT 18 [ELLIPSE 100 200 RIGHTROLL 10] PERSPECTIVE REPEAT 72 [ELLIPSE 2 200 100 RIGHTROLL 5 FORWARD 5]

PERSPECTIVE REPEAT 18 [ELLIPSE 100 200 RIGHTROLL 10] PERSPECTIVE REPEAT 72 [ELLIPSE 2 200

PERSPECTIVE REPEAT 18 [ELLIPSE 100 200 RIGHTROLL 10] PERSPECTIVE REPEAT 72 [ELLIPSE 2 200 100 RIGHTROLL 5 FORWARD 5]

TO pentagon CS REPEAT 360 ~ [ PENERASE REPEAT 5 [FD 100 RT 72]

TO pentagon CS REPEAT 360 ~ [ PENERASE REPEAT 5 [FD 100 RT 72] RT 1 PENPAINT REPEAT 5 [FD 100 RT 72] WAIT 1 ]

ARC Commands PERSPECTIVE REPEAT 36 [RIGHTROLL 10 ARC 90 100] PERSPECTIVE REPEAT 36 [RIGHTROLL

ARC Commands PERSPECTIVE REPEAT 36 [RIGHTROLL 10 ARC 90 100] PERSPECTIVE REPEAT 36 [RIGHTROLL 10 ARC 2 180 100 ARC 2 -180 100] CIRCLE Commands PERSPECTIVE REPEAT 36 [CIRCLE 100 RIGHTROLL 5] PERSPECTIVE REPEAT 72 [CIRCLE 2 100 RIGHTROLL 5]

Thank you

Thank you