Skip to content

Instantly share code, notes, and snippets.

@SamStenton
Created November 26, 2015 12:29
Show Gist options
  • Save SamStenton/791a5a16dc1a8362cc42 to your computer and use it in GitHub Desktop.
Save SamStenton/791a5a16dc1a8362cc42 to your computer and use it in GitHub Desktop.
def drawPenultimatePatch(win, location, colour):
loX = location.getX() - 100
loY = location.getY() - 100
rect = Rectangle(Point(loX, loY), location)
rect.draw(win)
for line in range(0,5):
SloY = loY + (20*line)
for row in range(0,5):
SloX = loX + (20*row)
for line2 in range(0,2):
for row2 in range(0,2):
circle = Circle(Point(SloX + (line2*10) + 5, SloY + (row2*10) + 5), 5)
rect = Rectangle(Point(SloX, SloY), Point(SloX + 20, SloY + 20))
if row%2 == 0 and line%2 == 0 or row%2 == 1 and line%2 == 1:
circle.setFill(colour)
rect.setFill("white")
else:
circle.setFill("white")
rect.setFill(colour)
rect.draw(win)
circle.draw(win)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment