miniproject1

miniproject1 - if houseSize > lotSize: print...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#Katie Flint #Collaborated with Jennifer Irwin #kflint3@gatech.edu def square(t,length): for side in range (4): forward(t,30) turn(t,90) def triangle(t,length): for side in range (3): forward (t,30) turn (t,-120) def circle (t,length): for side in range (18): turn(t,35) forward(t,10) def house(t,height): turn(t,90) square(t,30) triangle(t,30) def tree(t, height): forward(t,20) turnLeft(t) circle(t,10) turnLeft(t) def newNeighborhood(t,height): for side in range (1): forward(t,90) turn(t,0) triangle(t,30) #Welcome to the Neighborhood! def cityPlan(houses,lotSize,houseSize,treeHeight): if houseSize < 0 and lotSize <0 and houses <0 and treeHeight <0: print 'Sizes specified must be positive numbers'
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: if houseSize &gt; lotSize: print 'The house is too big for the lot' x=houses*lotSize y=houseSize*4 world=makeWorld(x,y) t=makeTurtle(world) penUp(t) moveTo(t,0,y-1) penDown(t) for i in range (houses-1): house(t,10) forward(t,30) turnRight(t) forward(t,30) turnLeft(t) penUp(t) forward(t,30) penDown(t) turnLeft(t) tree(t,treeHeight/2) penUp(t) turnRight(t) forward(t,houseSize) turnLeft(t) forward(t,10) turnLeft(t) penDown(t) house(t,10) forward(t,30) turnRight(t) forward(t,30) turnLeft(t) forward(t,20) turn(t,-90) newNeighborhood(t,90) penUp(t) moveTo(t,0,0)...
View Full Document

Page1 / 2

miniproject1 - if houseSize &amp;amp;gt; lotSize: print...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online