""" Author: Sohie Lee Purpose: Practice with nested loops and turtle graphics Date: a long time ago, in a galaxy far far away CS111 Nested Loop Lab Nested loops and turtle graphics Row houses that are inspired by Amsterdam row houses """ from turtle import * from turtleBeads import * import random import math # Note: new turtleBeads functions randomPastelColor, randomVibrantColor, # and randomMutedColor can be used to generate random colors. def makeWindow(size, c1, c2): '''Draws a square of size and color c1 with a smaller square of size/2 in color c2 nested inside. Maintains position and heading invariant. ''' color(c1) begin_fill() drawSquare(size) end_fill() color(c2) begin_fill() drawSquare(size/2) end_fill() # maintains position and heading invariant #--------------------------- # Testing code # # Uncomment tests below to test your code #--------------------------- def test() setupTurtle() noTrace() leap(-100) hop(-100) # # Testing makeBuilding (Task A) #makeBuilding(5, 2, 50, 'SlateGray', 'LightSkyBlue') #makeBuilding(2, 3, 50, 'SlateGray', 'LightSkyBlue') #makeBuilding(5, 2, 50, 'SlateGray', 'LightSkyBlue') # # Testing makeRandomColorBuilding (Task B) # makeRandomColorBuilding(8,1, 30) # # Testing makeRowBuilding (Task C) #makeRowBuilding(6, 3, 50) # # Testing makeColumnBuilding (Task D) #makeColumnBuilding(6,3, 50) #makeColumnBuilding(2,5, 50) #cityScape(4) # ht() # hides the turtle showPicture()