Due: Friday 1/03 10:00am

Write a NetLogo program like this:

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 to n-of N AGENTSET with one useful exception for this problem:
    • It always returns one agent instead of an agentset.