To run correctly, REPEAT needs a number to tell it how many times to repeat, followed by a list of the instructions to be repeated. Logo starts from the left and reads the first word, the command REPEAT. Let’s take a look at one of the one-liners as an example: REPEAT 12 RT 30] Can you make one yourself? Now try these : PX REPEAT 10000 PX REPEAT 1000000 See if you can figure out how we made these patterns. To understand these ‘oneliners’, work from the first brackets outwards. REPEAT 12 RT 30] REPEAT 6 BK 100 RT 60] REPEAT 6 RT 60] REPEAT 8 RT 90]] You can change the number of REPEATS to make more interesting patterns. RECTANGLES Who can create a command to draw a rectangle using the REPEAT function? Try this: REPEAT 2 The sum of the three angles in a triangle equals 180 degrees. If you have no equal sides, none of the angles will be equal. If you have two equal sides, you’ll have two equal angles. If you have three equal sides, you’ll have three equal angles. Think about the rules you have learnt in Math about various kinds of triangle : 1. TRIANGLES Now you can try to draw a triangle using the REPEAT command. Try this : REPEAT 4 What happens? Now try to draw this, and use the repeat function.ĪDVENTURES WITH SQUARES What other shapes can you make with squares? Try some of these:
Can anyone complete the following instructions: FD _ RT _ FD _ RT _ FD _ RT _ FD _ RT _ But surely there is an easier way than just repeating the same thing four times….yes, there is!
MSW LOGO – TUTORIAL TWO – MAKING SHAPES Let’s think about how to draw a sqaure using MSW logo. What happened? What do you need to do? Task: Try to write your name using logo commands. Try the following: PENERASE or PE in shorthand BACK or BK 60 Now, try to complete the shape correctly. Since you want to erase that last line, you just move the turtle back over it. What happened and how can it be solved? (check the pictures above…). To show the turtle again, type SHOWTURTLE or ST.ĮRASING What if you make a mistake when drawing a shape? Type the following: FD 50 RT 120 FD 50 RT 120 FD 60 HIDING AND SHOWING THE TURTLE If you don’t want to see the turtle, type HIDETURTLE or HT. Write them next to the following pictures: The turtle can do three commands with the pen down. You can tell the turtle you want it to put it’s pen down or pick it’s pen up.
THE TURTLE’S PEN What if you wanted to move the turtle without drawing a line? That’s easy. TURTLE SHORTHAND We can write Turtle commands in shorthand : FD = BK= RT= LT= CS=
Got it?! Practice moving the turtle around the screen! So, when using the FORWARD and BACK commands the turtle moves around the screen, but using LEFT and RIGHT only turns the turtle and does not move it. 2) To turn the turtle from facing the top of the screen to facing the bottom of the screen. Try : RIGHT _ LEFT _ Question: What number should you enter to: 1) Turn the turtle to face exactly the side of the screen. To turn the turtle, we have to tell it to turn right or left. Type FORWARD, press space and enter a big number like 200. TURTLE DIRECTIONS The turtle can go forward, back, right and left. The turtle can draw shapes with it’s pen. Your instructions are recorded in the command box.
You will type your instructions into the input box. You will give commands, you will draw shapes and you will write procedures. MSW LOGO – TUTORIAL ONE - INTRODUCTION MSW logo is the perfect introduction to computer programming.