2015-11-25 HW

posted Nov 25, 2015, 4:52 AM by Samuel Konstantinovich   [ updated Nov 25, 2015, 7:11 AM ]
Goal: Netlogo parameters vs sliders, randomness.
HW:
Complete Netlogo Tutorials: 11, 12, 13
You can be quizzed on Tuesday on videos 8-13. Please make sure you watch the videos and try the exercises. 

Classwork:  Do Now 1+2 write answers in your notebooks.


1. How do we turn randomly from negative max-angle to positive max-angle? (Discuss with neighbors and come up with some code that does it on paper)

What is the difference between the outcomes of the following:
Roll two 6-sided dice.
Roll one 11-sided die, then add 1 to the result.

2. You have a slider numSides set to 8:
numSides   3|----|-----------|50
                 8
Now when you make a function like ngon, what do you put in the  ??? of the repeat command? 
to ngon [ n size ]
    repeat  ???  [ correct code here ]
end
Why do we use that instead of the other? (This question is the most important one of the day)

(discussion then complete LabN01 using modifications in parts 3-5)

MODIFY LABN01:
3. Add a slider to your lab for max-angle (max turning angle for turtles)

4. Add a parameter to wiggle maxTurn, use your slider when you call wiggle.

to wiggle [ howFar maxTurn]
   ???;remember #2 of the do now!
end

5. Change your 'go' button:
every 0.02 [ 
    ;wiggle ????  
]

This will go 50 times per second.  It requires that 0.02 seconds pass before the go command is triggered again. 


Comments