Presentation is loading. Please wait.

Presentation is loading. Please wait.

An introduction to Logo Mike Warriner Engineering Director, Google Note: This course is not an endorsement of Logo by Google. All views in this document.

Similar presentations


Presentation on theme: "An introduction to Logo Mike Warriner Engineering Director, Google Note: This course is not an endorsement of Logo by Google. All views in this document."— Presentation transcript:

1 An introduction to Logo Mike Warriner Engineering Director, Google Note: This course is not an endorsement of Logo by Google. All views in this document are solely those of the author.

2 What’s Logo?

3 Turtle Graphics Lubna Sorour

4

5

6

7 FORWARD 15

8 RIGHT 90

9 FORWARD 15 RIGHT 90 FORWARD 15

10 We’re going to learn 3 things today How to draw pretty pictures How to save lots of typing If we’re quick, the three building blocks of programming: Looping – doing the same thing lots of times Variables – saving values that we want to use elsewhere Functions – several lines of code we want to use again & again Note : Functions are sometimes called Procedures or Methods. This is going to be a quick run through – don’t be worried if you don’t understand everything today!

11 Basic Logo Commands FORWARD - followed by the number of steps BACKWARD - followed by the number of steps RIGHT - followed by the angle of rotation LEFT - followed by the angle of rotation

12 Basic Logo Commands FD BK RTLT

13 Turning around

14 FD 50 PU FD 50 PD FD 50 Huh!!!

15 PU = PenUp PD = PenDown

16 Let’s get started…

17 http://www.mikewarriner.com/jslogo Or use LOGO on your desktops

18 Task – draw some pictures SQUARE FD 100 RT 90 FD 100 RT 90 FD 100 RT 90 FD 100 TRIANGLE FD 100 RT 120 FD 100 RT 120 FD 100 PENTAGON FD 100 RT 72 FD 100 RT 72 FD 100 RT 72 FD 100 RT 72 FD 100 HEXAGON FD 100 RT 60 FD 100 RT 60 FD 100 RT 60 FD 100 RT 60 FD 100 RT 60 FD 100 HINT : type CLEARSCREEN before each picture to clear the screen and bring the turtle back home

19 LOOPS Think of a loop as a way to save typing. REPEAT 4 [FD 100 RT 90]

20 Basic structure is to tell Logo that you want to repeat something REPEAT Followed by the number of times you want to repeat it REPEAT 3 Followed by the thing you want to repeat in square brackets REPEAT 3 [FD 100 RT 90] LOOPS

21 Task – try these using loops SQUARE FD 100 RT 90 TRIANGLE FD 100 RT 120 PENTAGON FD 100 RT 72 HEXAGON FD 100 RT 60

22 Variables Make "size random 500 Print :size make – creates a variable with a value "size– sets a variable called size :size – gets the value of the variable called size Try this now! Press Run lots of times and see what happens

23 Adding things to Logo - Functions Function save typing… even more typing than loops: TO star REPEAT 5 [FD 50 RT 144] END star

24 Adding things to Logo - Functions Function save typing… LOTS of typing… TO star REPEAT 5 [FD 50 RT 144] END star

25 Adding things to Logo – Variables in functions TO randomstar make "size 50 + random 500 REPEAT 5 [FD :size RT 144] END clearscreen randomstar make – creates a variable with a value "size– sets a variable called size :size – gets the value of the variable called size

26 Adding things to Logo - Parameters TO square :size REPEAT 4 [FD :size RT 90] END Clearscreen Repeat 36 [square 100 rt 10]

27 Recap on what we learnt… How to draw pretty pictures How to save lots of typing Looping – doing the same thing lots of times Functions – several lines of code we want to use again & again Note : Functions are sometimes called Procedures or Methods. Variables – saving values that we want to use elsewhere

28 Where next? http://www.mikewarriner.com/jslogo - Online LOGO interpreter you can play with at home http://www.mikewarriner.com/docs - This document and others http://turtleacademy.com/ - A good learning resource for Logo to go to next. Uses the same online interpreter above.

29 Out of time! Thanks for listening.


Download ppt "An introduction to Logo Mike Warriner Engineering Director, Google Note: This course is not an endorsement of Logo by Google. All views in this document."

Similar presentations


Ads by Google