- Open the Scratch project
- Add move and turn blocks to get to as many artefacts as possible
- Put a wait 1 sec block before every move
- Archaeologibots scratch project
- Plan and create a picture in LOGO
- Use
- repeat
- setxy
- procedures (at the beginning)
Repeat
repeat
[
instructions
]
Double repeat – eg square of shapes
repeat 4
[
repeat
[
pattern code
]
rt 90
]
Setxy
pu setxy 100 200 pd
Procedures
to thing
instructions for thing
end
thing
Variables
make “length 20
fd :length
Make “length :length + 1
Procedures with variables
to square :side (don’t need to make “side)
fd :side rt 90
end
square 40
Can have more than one variable, eg
to shape :length :angle :col
repeat 4
[
colour :col
fd :length rt :angle
]
Lists
make “cols [“red “blue “purple]
item 3 :col
Success steps
- Plan your shape (could draw it first eg in j2e5)
- Type – Play – Think – Edit – Type – Play ….
- Be resilient
Text
Start a new project with the following and save it as “y6logo 2”
- reset
- setpensize 5
Repeat task
- repeat 4 [fd 40 rt 90] draws a square:
- the instructions inside the [] “fd 40 rt 90” are the ones to do again and again
- the “4” means repeat it four times
- Copy the code above to draw a square
- Copy and paste the code again
- Try changing the 4 to a 5. What happens?
- Now change the “rt 90” to “rt 72”
- Copy the code again
- Try changing repeat to 6 – what should the “rt” number be?
- Now try repeat 7: when you draw the shape, the total angle turned is 360 because it comes back to the beginning. It has 7 equal angles so each angle needs to be….360…7
- Copy the code again
- Draw an Octagon (8-sided) and a Nonagon (9-sided)
- Save (if you haven’t already!)
Finished? You should have on your page:
- A square, pentagon, hexagon, heptagon, octagon and nonagon
Setxy
- Setxy is used to move the arrow to a different position on the canvas
- setxy 50 100 sends the arrow to the coordinates (50, 100)
- This Scratch project shows you what the different coordinates are:
- x y coordinate finder (only goes up to 240/180 in Scratch – in LOGO it goes up to 250 on each axis)
- NOTE if the pen is down, it will draw a line to the new position – so it is quite useful to use with pu and pd:
- pu setxy 50 100 pd – will send it to the new place without drawing then is ready to draw
- Use “pu setxy …. pd” to move your shapes from the first section to different places on the canvas.
Procedures
- Procedures are used to avoid typing the same thing several times.
- Use a procedure if you need to repeat something in your picture, eg windows in a house, snowflakes, stars, a fence, stripes, eyes….
- A procedure teaches the computer how to do a shape but doesn’t draw it. Then you “call” the procedure to make it draw it.
- Instead of “repeat 4 [fd 40 rt 90]” at the beginning of your code, have this:
to square
repeat 4 [fd 40 rt 90]
end
- When you play, it will not draw the square – you have only told it how to – not to actually draw it.
- Now type “square” after the procedure and it should draw the square. You have taught it how to draw a square!
- Procedure are usually all at the beginning of the code.
- Make procedures called “pentagon” and “hexagon”
- Instead of drawing one pentagon, use the code: repeat 6 [pentagon rt 60] to make a pentagon flower!
- Make a procedure to fill your shape:
- to fillshape
- pu rt 45 fd 10
- fill
- bk 10 lt 45 pd
- end
- to fillshape
- Call the procedure after each shape you do.
Variables
Lists
Success steps
- Save (as) different versions
- Experiment with new code
- Find your own mistakes by reading your code carefully
- Use repeat, setxy and procedures in your own code
- Open this project: Letter L
- Add repeat 4 [ BEFORE the L code
- Add ] at the END
- It should do this:
- Tidy up the code by using return and spaces so it looks like this:
- Now put repeat 4 [ before this code
- At the end, put rt 90 ]
- Tidy up the code so it looks like this:
- It should look like this:
- Can you write your own letter code (with a finger space) and do the same?
- What happens if you make your code like this?
- repeat 10 [
- your letter code
- rt 36 ]
Resources
Finished?
Carry on with LOGO letters 2 and 3…please ask for the sheet of instructions and the help videos are below:
- j2e – j2code – LOGO
- Start with: reset setpensize 4
SQUARE
- Draw a square using the repeat command
SQUARE with VARIABLE
- To make a spiral, we need to increase the length each time it repeats.
- To do this we will make a variable called “length” that we can control.
- Before the square code, type: make “length 30
- Replace your fd 40 by fd :length
- Try your code – try changing the number after make “length to make different sized squares.
SPIRAL
- Start with make “length 30
- Inside the repeat brackets put the following line:
- make “length :length +10
- NOTE the difference between “len and :len (“len is for changing it; :len is for using/calculating with it)
- Increase the number of repeats
What variations can you create? Save different versions for each one you do.
Here are some example projects to help you learn some more LOGO commands.
- Go to “my files” and open your project from last week.
- Complete your three letters.
- If you need to start again:
- Click on Level 2
- Click the “eraser” on the code and the picture
- Go back tot Level 1
- Edit the LOGO code to make your three letters different colours and thicknesses.
- Add colour “red setpensize 10 before each pendown
- To make more space in your code press the “return” or “enter” key:
- Use this help video if you need to: LOGO Letters 1
- Carry on with LOGO letters 2 and 3…
- Click on the three dots then settings
- Scroll to the bottom of the settings then click “show advanced settings”
Accessiblity options
- Find “Accessibility settings”
- Tick “Show accessibility options in the system menu”
Screen size
- Find “Device” then “Display settings”
- Set resolution to 1536×864
- Find “Web content” – set Page zoom to 125%