Work 23: 11/14

posted Nov 14, 2018, 9:48 AM by JonAlf Dyrland-Weaver   [ updated Nov 14, 2018, 11:37 AM ]
Write a NetLogo program with the following features.
  • Interface
    • num_reds: slider for the number of red turtles
    • num_blues: slider for the number of blue turtles
    • bomb_drop_chance: slider for % chance turtles drops a bomb
    • monitors to display the number of red and blue turtles.
    • buttons for the setup and go (forever) procedures, using the sliders where applicable.
  • Procedures
    • Setup (you should have this from yesterday)
      • Takes 2 arguments representing the number of red and blue turtles.
      • Clear the world.
      • Create red turtles randomly scattered about the top of the world.
      • Create blue turtles randomly scattered about the bottom of the world.
    • Wiggle
      • Turtles should move forward 1 and rotate randomly as you see fit.
    • Go
      • Takes 1 argument representing the % chance a turtle "drops a bomb"
      • Turtles should wiggle
      • If a turtle lands on a patch of the opposite color (a "bomb"), the turtle should die and the patch should reset back to black.
      • If a turtle lands on a black patch, it should have a chance to change the patch's color to its own, the chance is set by the parameter.
      • Include wait to slow down your program.
    • Also write a reporter to be used by the monitors.
Submit this as redVblue


BUT WAIT, THERE'S MORE!
  • In preparation for Thursday's review session, you may want to do the following:
    • Create a reference sheet that you can use during the exam.
    • Requirements:
      • Regular letter sized paper (8.5" X 11")
      • Your name and class period must be legibly displayed in the upper-left-hand corner of the sheet when held in portrait-mode.
      • You can either hand-write or type up the sheet.
        • If typing, you cannot use a font size smaller than 12point.
      • You may use both sides of the sheet.
    • The reference sheet can maintain any information you'd like.
    • You must hand in the reference sheet to me at the beginning of Thursday's class! If you are absent, a buddy from the class must hand it in for you.
    • You will be given your reference sheets back on Friday.
Comments