Professional Documents
Culture Documents
Programming Basic
Programming Basic
201939215
import turtle
import random
def screenLeftClick(x,y):
global a,b,c
tSize = random.randrange(1,10)
turtle.shapesize(tSize)
a = random.random()
b = random.random()
c = random.random()
turtle.pencolor((a,b, c))
turtle.pendown ()
turtle.goto(x,y)
def screenRightClick(x,y):
turtle.penup()
turtle.goto(x, y)
pSize = 10
a,b,c = 0.0, 0.0,0.0
turtle.title('move turtle')
turtle.shape('turtle')
turtle.pensize (pSize)
turtle.onscreenclick(screenLeftClick, 1)
turtle.onscreenclick(screenMidClick, 2)
turtle.onscreenclick(screenRightClick, 3)
turtle.done()