LOGO bug challenges
- Go to My files – Shared files – st-marks-wilts-sch-ujk – LOGO debugging
- Open logo bug challenge 1 – correct the code – you should get a spiral and a message when you press play
- Repeat with logo bug challenges 2 and 3
Squares
- Go to j2code – LOGO – level 3
- Type this:
reset
setpensize 5
- Type the following to draw a square.
repeat 4 [fd 50 rt 90]
- Can you explain why this draws a square?
- Change the code so that the suqare is:
- twice as big
- half the size
- has only three sides drawn, like this
Using variables
- After setpensize 5, add a line (using return key)
- Type this:
make “length 50
- Now change your square code, swapping the fd number for :length
repeat 4 [fd :length rt 90]
- Try changing the number in the make “length line of code
- Now make you whole code look like this:
reset
setpensize 5
make “length 50
repeat 10
[
repeat 4 [fd :length rt 90]
make “length :length + 10
]
- Can you explain it?
- Play with it – try changing some numbers to make more squares, smaller differences
- Challenge – can you make it do this just by changing the length starting number and how much it changes?