# YieldSign.py P. Conrad for CS5NM, 10/17/2008, UCSB # Code from Think Python, by Allen B. Downey, Chapter 4 # Basics of TurtleWorld graphics import sys sys.path.append("/Users/Shared/PhillWorkStuff/CS5NM/swampy.1.1") from TurtleWorld import * world = TurtleWorld() bob = Turtle() # create a turtle, and call him bob def drawSign(t,w): fd(t,w) #draw across the top rt(t,120) fd(t,w) #draw right side rt (t,120) fd(t,w) #draw left side bk(t,w) # go back so you can draw the post lt(t,150) fd(t,2*w) #draw the pole #return bob to starting position and angle bk(t,2*w) lt(t,30) bk(t,w) lt(t,60) # move back 150, and up 150 to start pu(bob) bk(bob,150) lt(bob) fd(bob,150) rt(bob) pd(bob) # draw three signs drawSign (bob,100) pu(bob) fd(bob,150) pd(bob) drawSign(bob,50) pu(bob) fd(bob,75) pd(bob) drawSign(bob,150) wait_for_user() # keep the screen open til we click the red X or circle to quit