Due: Tuesday 12/17 10:00am

Write a NetLogo program with the following Features:

Example: http://homer.stuy.edu/~dw/netlogo/work32_obf.html

  • Interface
    • A slider called numColors
      • Should start at 1 and go to 14
    • Monitors to show the number of patches for each true NetLogo color.
    • Include buttons for each procedure listed below
  • Procedures
    • setup: observer
      • Have every patch set its color to a random color.
      • The number of colors should be based on the numColors slider.
      • The possible colors should be the “true” NetLogo colors (i.e. 5, 15, 25, …).
    • setupEqual3: observer
      • Have every patch set its color to either gray, red or orange.
      • The colors should be randomly chosen, but there should be exactly the same number of patches for each color.
    • setupEqual: observer
      • Have every patch set its color to a random color.
      • The number of colors should be based on the numColors slider.
      • The possible colors should be the “true” NetLogo colors (i.e. 5, 15, 25, …).
      • The colors should be randomly chosen, but there should be exactly the same number of patches for each color (if the number of colors does not evenly divide the number of patches, then any leftover patches should be black).