Due: Tuesday 12/10 10:00am
Submission name: work29.nlogo
Write a NetLogo program with the following Features:
- Interface
- A slider called
num_sides
- Should start at 3 and go to a reasonable number (like 20)
- A slider called
side_length
- Should start at 1 and go to a reasonable number
- A slider called
pattern_angle
- Should start at 0 and go to 360
- For each slider, set the initial value to be something that makes sense, play around with the values to see what works well
- Include buttons for each procedure listed below, pass the sliders as arguments when making the buttons.
- Procedures
setup [n]
: observer
- Clear the screen and make
n
turtles (you can add custom features to the turtle if you wish)
regulargon [n s]
: turtle
- Draw a regular polygon with
n
sides of length s
pattern [n s angle]
: turtle
- Call
regulargon
and then turn right by angle
degrees.
- Make the button for
pattern
a forever button!
turtle_spread
: turtle
- Have the turtle point up.
- Set the turtle’s x coordinate to 0
- Set the turtle’s y coordinate such that:
- turtle 0 is at the bottom of the world (-16)
- All other turtles are evenly spaced along the y-axis. This will depend on how many turtles there are.