Code Sketch


traingle pattern
By: Aasthajaiswal
Category: Art
cleari
setBackground(Color(204, 255, 204))

// triangle pattern
//showAxes()
//showGrid()
setPosition(-240, 130)
setSpeed(superFast)
setPenColor(black)
setPenThickness(1)
setFillColor(Color(0, 153, 0))
    hop(10)
    // single triangle pattern
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
right()
hop(65)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(28)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
left()
repeat(2){
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
}
left()
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
//done
//repeating to make border
repeat(5){
right(270)
hop(80)
left()
hop(70)
left()
hop(53)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
right()
hop(65)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(28)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
left()
repeat(2){
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
}
left()
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
}
hop(29)
right(270)
hop(360)
right(180)


repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
right()
hop(65)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(28)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
left()
repeat(2){
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
}
left()
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}

left(270)
hop(82)
left()
hop(129)
left()
hop(53)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
right()
hop(65)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(28)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
left()
repeat(2){
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
}
left()
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
left(179)
hop(37)

repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
right()
hop(65)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(28)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
left()
repeat(2){
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
}
left()
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}


repeat(3){
hop(30)
right()
hop(66)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
right()
hop(65)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(28)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
left()
repeat(2){
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
}
left()
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
}


right()
right()
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
right()
hop(65)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(28)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
left()
repeat(2){
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
}
left()
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}


hop(30)
right()
hop(60)

repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
right()
hop(65)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(28)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
left()
repeat(2){
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
}
left()
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(23)
right()
hop(46)

repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
right()
hop(65)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(28)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
left()
repeat(2){
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
}
left()
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
right(174)
hop(452)
right(95)

repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
right()
hop(65)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(28)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
left()
repeat(2){
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
}
left()
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(25)
right()
hop(48)

repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
right()
hop(65)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(28)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
left()
repeat(2){
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
}
left()
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}

hop(25)
right()
hop(63)

repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
right()
hop(65)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(28)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
left()
repeat(2){
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
}
left()
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}
hop(30)
repeat(9){
    right()
 repeat(3){
    right(120)
forward(20)   
 }
}