Understanding Simple Logo Drawing Commands - IECD Program Theory & Practical

Slide Note
Embed
Share

Exploring the simple Logo drawing commands used in the Institute for Entrepreneurship and Career Development (IECD) program. Learn about moving the turtle, pen controls, setting pen size and color, hiding/showing the turtle, and more through practical examples and images.


Uploaded on Sep 28, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


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

  2. 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

  3. Sample movement of Turtle FD 50 RT 90 FD 50 RT 90 FD 50 RT 90 FD 50 RT 90

  4. 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 SetPenSize [n n] Sets the width of the pen to n pixels. Note that it is necessary to put in two numbers. Example: SetPenSize [5 5] SETPC 5 FD 50 Setpensize [5 5] SETPC 8 FD 50 Pennormal Sets the pen back to normal mode

  5. 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

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

  7. 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.

  8. 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 ARC2 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

  9. 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]

  10. 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]]

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

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

  13. PERSPECTIVE repeat 18 [ellipse 100 200 rightroll 10]

  14. 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 [ELLIPSE2 200 100 RIGHTROLL 5 FORWARD 5]

  15. PERSPECTIVE REPEAT 18 [ELLIPSE 100 200 RIGHTROLL 10] PERSPECTIVE REPEAT 72 [ELLIPSE2 200 100 RIGHTROLL 5 FORWARD 5]

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

  17. ARC Commands PERSPECTIVE REPEAT 36 [RIGHTROLL 10 ARC 90 100] PERSPECTIVE REPEAT 36 [RIGHTROLL 10 ARC2 180 100 ARC2 -180 100] CIRCLE Commands PERSPECTIVE REPEAT 36 [CIRCLE 100 RIGHTROLL 5] PERSPECTIVE REPEAT 72 [CIRCLE2 100 RIGHTROLL 5]

  18. Thank you

More Related Content