2015-11-24 HW + LABN01

posted Nov 24, 2015, 4:55 AM by Samuel Konstantinovich   [ updated Nov 24, 2015, 5:21 AM ]
1.You are responsible for watching Tutorials: 8, 9, 10. You may have a quiz on these videos. 
2. You must finish your classwork.

LabN01 continued:
A - Put your n-gon procedure in a new netlogo file.
B - make a slider for number of sides called number-of-sides.
C - make a slider for the length of each side called side-length.

On paper: What should the min/max values of each slider be? Decide what they should be and justify your choices. 

For D and E your n-gon function should use the number-of-sides and side-length sliders to change how the ngon is drawn.

D - make an observer button called make ngon to ask all turtles to draw an n-gon.
E - make a turtle button that just calls ngon.

D and E will accomplish the same thing. You should be aware that a turtle button just asks all turtles to run the commands in the button.

Test if your netlogo model works so far.

F - make a slider for number of turtles called num-turtles. (min/max value?)
G - make a button called setup that: 
   1. Resets the world.
   2. Spawns num-turtles turtles based on a slider. The x and y positions should be set randomly based on your world size. 
See: random and max-pxcor in dictionary
also see: random-pxcor

H -make a speed slider (speed should be really small numbers, between 0.05 and 0.5)

H - make a turtle context wiggle function that has a parameter for how far to move forward
    Make the turtle turn randomly and move forward the parameter number of units.

How much turning should the turtles do to make a "wiggle" like motion? Try different values. 
Do your turtles always turn in one direction? If so why?

I - Make a button called go that will have all turtles wiggle the "speed slider" units forward. Test the "forever" checkbox. What does it do?