Code Sketch


a pattern using triangles and hexagons .
By: CHICANE FERNANDES
cleari()

setSpeed(superFast)
setBackgroundH(cm.black,cm.darkMagenta)

def shapes (steps:Long,size:Double,side:Long)
{
    if(steps==0)
    {
        
    }
    else
    {
        forward(size)
        right(360/side)
        shapes(steps-1,size,side)
    }
}

def pattern(steps:Int,number:Int)
{
  if(steps==0)
  {
    
  }
  else
  {
    right(360/number)
    setPenColor(cm.black)
    setFillColor(cm.magenta.fadeOut(0.6))
    shapes(6,80,6)
    setFillColor(cm.darkBlue.fadeOut(0.7))
    shapes(3,60,3)
    pattern(steps-1,number)
  }
}


pattern(11,11)