Due: Thursday 12/12 10:00am

Patch Patterns!

Write a NetLogo program with the following Features:

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

  • Interface
    • A slider called numColors: [1, 14]
    • A slider called angle: [0, 360]
    • Include buttons for each procedure listed below, pass the appropriate slider value when required.
  • Procedures
    • setup: observer
      • Clear the screen and create 1 turtle, the turtle should have its pen down
    • randomColors [r]: patch
      • 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, …).
    • wiggle0 [theta]: turtle
      • wait 0.1 of a second
      • Makes a turtle move forward 1 unit
      • Makes a turtle turn right a random number of degrees in the range [0, theta).
    • wiggle1 [theta]: turtle
      • wait 0.1 of a second
      • Makes a turtle move forward 1 unit
      • Makes a turtle turn right a random number of degrees in the range [0, theta/2).
      • Makes a turtle turn left a random number of degrees in the range [0, theta/2).
    • wiggle2 [theta]: turtle
      • wait 0.1 of a second
      • Makes a turtle move forward 1 unit
      • Makes a turtle turn right a random number of degrees in the range [-theta/2, theta/2).