I swapped columns and rows, imported the module and call each function or class module.call() so it is clear that the calls are made to graphics objects. Other than that, it works as I modified it in my previous post.
Code:
import graphics
def drawCircle(win, centre, radius, colour):
circle = graphics.Circle(centre, radius)
circle.setFill(colour)
circle.setWidth(2)
circle.draw(win)
def drawEye(win,x,y):
centre = graphics.Point(x,y)
drawCircle(win, centre, 50, "white")
drawCircle(win, centre, 25, "blue")
drawCircle(win, centre, 10, "black")
def windowsOfEyes(columns,rows):
win = graphics.GraphWin("", 100 * columns, 100 * rows)
for i in range(columns):
for j in range(rows):
drawEye(win,i*100+50,j*100+50)
windowsOfEyes(4,2)
Comment