Work 18: 10/26

posted Oct 26, 2018, 11:22 AM by JonAlf Dyrland-Weaver
Write the following NetLogo procedures:
  • setup
    • observer context
    • should clear the screen and create a single turtle, facing up.
  • square 
    • turtle procedure with 1 parameter
    • commands a turtle to draw a square where the side length is given by the parameter
  • triangle
    • turtle procedure with 1 parameter
    • commands a turtle to draw an equilateral triangle where the side length is given by the parameter
  • hexagon
    • turtle procedure with 1 parameter
    • commands a turtle to draw a regular hexagon (6 sided figure) where the side length is given by the parameter
  • regularPolygon
    • turtle procedure with 2 parameters [n, l]
    • commands a turtle to draw a regular polygon with n sides of length l
Challenge:
  • rightTri
    • turtle procedure
    • commands a turtle to draw a right triangle
  • HA!
    • turtle procedure
    • have a turtle draw "HA!" on the screen.
    • or have the turtle draw any message you'd like
submit this as turtle_draw
Comments