Class Room Practice in Drawing with NetLogo

Today we will do a set of exercises that will help you get better acquainted with netlogo.  You are to use the help button and the dictionary to complete the following.

1.  Create a setup button and corresponding code in the Code section that will create 1 turtle facing up of color blue.  Be-sure and start this procedure with a clear-all.   Test it

2. Now create a new button and associated procedure called drawsquare that will draw a 10 by 10 square in the center of the screen.  Here is what it should look like

3.  Now create another button that draws a 10 by 10 by 10 equilateral triangle centered.

4. Add a slider that determines the size of the objects.  Let its range be from 0 20 and apply to both the square and the triangle.  Test it.

5. Now draw a hexagon, centered and the associated button.

6.  After you have the above complete and working independent of each other ( IE you first hit setup and then the appropriate button , see what happens when you click setup and then the three buttons.  Do they all draw properly.  If not fix it.

7.  Here are a list of other features you can add to the program

1.  add a slider that determines the thickness of the line that is drawn.

2.  add a slider that determines the number of degrees the object is rotated.

3.  Add an on/off switch that indicated if the object is to be filled in with a spiral all the way down to 0

4. Can you think of others?


Comments are closed.