tutleblast

import random
import turtle
wn=turtle.Screen()
wn.bgcolor(“red”)
rose=turtle.Turtle()
rose.color(“white”)
for i in range(1, 100):
angle=random.randrange(0, 45)
length=random.randrange(0, 150)
rose.left(angle)
rose.forward(length)
rose.backward(length)

wn.exitonclick()

blastingturtle

 

This is a Python program in which a blast is created by calling ‘ turtle’ library. In this case, I called ‘turtle’ rose.  I programmed it to randomly go forward and backward, left and right, in an angle of 0, 45 and 0, 150 respectably.  And I created a ‘for’ loop which repeated 100 times starting at one.

Leave a Reply

Your email address will not be published. Required fields are marked *