Due: Friday 1/03 10:00am
Submission name: work35.nlogo
Write a NetLogo program like this:
- Example: http://homer.stuy.edu/~dw/netlogo/work35_obf.html
- This program will use some procedures related to work32, you can find solutions in thesource repository.
Interface
- colors: slider, [1, 14]
- neighborsOnly: switch
- Plot showing how many patches are of each true NetLogo colors.
setup
- Clears the screen.
- Resets ticks (
reset-ticks
) - Make every patch one of the true NetLogo colors (based of colors slider), with as equal distribution as possible. If there are any patches left out of the distribution, have them pick one of the possible colors at random.
tick
colorSwap
- This should be an observer procedure.
- Wait a short amount of time.
- Have every patch change their color to the color of a different randomly selected patch.
- If
neighborsOnly
is on, then the color should be chosen from a randomly selected neighbor. tick
one-of AGENTSET
is similar ton-of N AGENTSET
with one useful exception for this problem:- It always returns one agent instead of an agentset.