# 多边形的画法 

 def ployon(num, distance): 

 #     bob.color('blue', 'red') 

     bob.color("red", "yellow")  

     for i in range(num): 

         bob.fd(distance) 

         bob.lt(360 / num) 

         time.sleep(1)  

     bob.end_fill() 

     bob.filling() 

     time.sleep(3) 

     bob.reset() 



 # ployon(3, 100) 

 # ployon(4, 100) 

 # ployon(5, 100) 

 # ployon(6, 100) 

 # ployon(7, 100) 

 # ployon(8, 100) 



 # # 五角星的画法 

 # bob.color("red", "yellow")  

 # for i in range(5): 

 #     bob.fd(200) 

 #     bob.right(180 - 36) 

 #     time.sleep(0.5) 

 # bob.end_fill() 

 #   

 # bob.reset() 

 #  

 # # 八角星 

 # bob.color("red", "yellow")  

 # for i in range(8): 

 #     bob.fd(200) 

 #     bob.right(180 - 45) 

 #     time.sleep(0.5) 

 # time.sleep(10) 

 #  

 # bob.reset() 



 # 六角星 

 # bob.color("red", "yellow")  

 # for i in range(3): 

 #     bob.fd(200) 

 #     bob.right(180 - 60) 

 #     time.sleep(0.5) 

 #      

 # bob.up()    

 # bob.lt(30) 

 # bob.fd(200 / math.sqrt(3)) 

 # bob.rt(90) 

 # bob.down() 

 #  

 # for i in range(3): 

 #     bob.fd(200) 

 #     bob.right(180 - 60) 

 #     time.sleep(0.5) 

 # time.sleep(2) 

 #  

 # bob.reset() 





 # 迷宫的画法 

 def squareSpiral(ra): 

     bob.pencolor("green") 

     for x in range(100): 

         bob.forward(x) 

         bob.left(ra) 

     time.sleep(3) 

     bob.reset() 





 def circleSpiral(ra): 

     bob.pencolor("green") 

     for x in range(100): 

         bob.circle(x) 

         bob.left(ra) 

     time.sleep(3) 

     bob.reset() 



 # 迷宫 

 # squareSpiral(90) 

 # # 大风车 

 # squareSpiral(91) 

 # # 漩涡 

 # circleSpiral(90) 



 # 花朵 

 # circleSpiral(60) 



 def circleSpiral2(ra): 

     bob.pencolor("green") 

     a = 0; 

     n = 360 / ra 

     while(a + 1 <= n): 

         bob.circle(50) 

         bob.left(ra) 

         a = a + 1 

     time.sleep(3) 

     bob.reset()