lab6.py - CS 177 u2013 lab6.py Qijia Zhu Following Coding...

This preview shows page 1 - 2 out of 3 pages.

## CS 177 – lab6.py# Qijia Zhu # Following Coding Standards and Guidelines# This interactive program creates two Graphics windows. The user can click# on the MOVE, STOP and EXIT buttons in the Control window to control the circle# in the Animated window. The user can also click on the circle and change its# fill color# import necessary modulesfrom graphics import*import mathimport randomfrom time import sleep# start defining make() functiondef make():# create an empty listbutton = []# create the graphics windowwin = GraphWin("Control",300,200)# create the rectangles and draw on the graphics windowmove = Rectangle(Point(40,30),Point(140,80))move.setFill("green")move.draw(win)stop = Rectangle(Point(160,30),Point(260,80))stop.setFill("red")stop.draw(win)exit1 = Rectangle(Point(100,120),Point(200,170))exit1.setFill("blue")exit1.draw(win)# create the text messages and draw on the graphics windowa = Text(Point(150,15),"Click MOVE to change the movement vector")a.setStyle("italic")a.setSize(11)a.draw(win)b = Text(Point(90,55),"MOVE")b.setStyle("bold")b.setSize(14)b.setTextColor("white")b.draw(win)

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture