Presentation is loading. Please wait.

Presentation is loading. Please wait.

Institute for Entrepreneurship and Career Development (IECD)

Similar presentations


Presentation on theme: "Institute for Entrepreneurship and Career Development (IECD)"— Presentation transcript:

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

2

3 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

4 Sample movement of Turtle
FD 50 RT 90 FD 50 RT 90 FD 50 RT 90 FD 50 RT 90

5

6

7

8

9

10 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 Pennormal Sets the pen back to normal mode

11

12 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 [ ] (Gives magenta) fill Floods the area bounded by lines with whatever color was specified in the setfloodcolor command. Example: fill

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

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

15 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. Show XCOR , SHOW YCOR arc arc arc

16

17

18

19

20

21

22

23

24

25 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]

26 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]]

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

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

29 PERSPECTIVE repeat 18 [ellipse rightroll 10]

30 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 RIGHTROLL 10]   REPEAT 72 [ELLIPSE RIGHTROLL 5 FORWARD 5]  

31 PERSPECTIVE REPEAT 18 [ELLIPSE RIGHTROLL 10]   REPEAT 72 [ELLIPSE RIGHTROLL 5 FORWARD 5]  

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

33 REPEAT 36 [RIGHTROLL 10 ARC 90 100]
ARC Commands PERSPECTIVE REPEAT 36 [RIGHTROLL 10 ARC ]   REPEAT 36 [RIGHTROLL 10 ARC ARC ] CIRCLE Commands REPEAT 36 [CIRCLE 100 RIGHTROLL 5] REPEAT 72 [CIRCLE2 100 RIGHTROLL 5]

34

35 Thank you


Download ppt "Institute for Entrepreneurship and Career Development (IECD)"

Similar presentations


Ads by Google