Warm up
- Read learning conversations, correct code
- Typing
Recap
- Following instructions….
- Variables
- 360/:sides
- setxy
- Efficient code
Success steps
- Follow instructions
- Try to understand why it works
- Debug by yourself
- Tinker with your code
- Copy and paste images to a j2e5 page
Let’s go: What is a spiral?
- Start a new LOGO file
- Type: reset setpensize 5
- Save it as spiral
- Lets set up two variables:
- make “sides 4
- make “length 30
- Copy this code:
- repeat 10
- [
- fd :length rt 360/:sides
- ]
- Play – it should just draw a square over itself a few times
- To make it a spiral, we need to make the length longer each time.
- Put the following code at the end but before the ] bracket:
- make “length :length + 10
- This should draw a spiral…if not, debug
- Tinker: Try:
- different values of “sides at the start
- increase the repeat number
- changing how much you add to “length in step 5.3
- adding a new variable called “pen (make “pen 3) then add these lines in the repeat brackets:
- setpensize :pen
- make “pen :pen + 1
- Right hand click each spiral and copy and paste it into a j2e5 page to show what spirals you have made.
- Create a page with at least 6 spirals on
Finished?
In a new LOGO file, type this simple code, play it then tinker with it…
reset
repeat 250 [forward repcount rt 89]