Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

ALI KHAN YUSUF

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)

def screenMidClick(x, y):


global a,b,c
tSize = random.randrange (1,10)
turtle.shapesize(tSize)
a = random.random()
b = random.random()
c = random.random()

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()

You might also like