Due: Thursday 12/11 10:00am
Submission name: work25.nlogo or work25.nlogox
Learn NetLogo
To get started with NetLogo, read the following 2 chapters in the online book, pay particular attention to the information about properties and how to change them:
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.
- A slider called
- Procedures
setup [n]: observer- Clear the screen and make
nturtles (you can add custom features to the turtle if you wish)
- Clear the screen and make
regulargon [n s]: turtle- Draw a regular polygon with
nsides of lengths
- Draw a regular polygon with
pattern [n s angle]: turtle- Call
regulargonand then turn right byangledegrees. - Make the button for
patterna forever button!
- Call
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.