以下為作業4內容

利用 iframe 嵌入投影片:

畫一隻會動的小烏龜

http://openbookproject.net/thinkcs/python/english3e/hello_little_turtles.html

我們今天要利用編輯器畫一隻烏龜

複製程式碼:

import turtle wn = turtle.Screen() wn.bgcolor("lightgreen") tess = turtle.Turtle() tess.shape("turtle") tess.color("blue")

tess.penup() # This is new size = 20 for i in range(30): tess.stamp() # Leave an impression on the canvas size = size + 3 # Increase the size on every iteration tess.forward(size) # Move tess along tess.right(24) # ... and turn her

wn.mainloop()

貼到scite編輯器

存檔後go

小烏龜就會動了:)))

w7 from yap on Vimeo.


Comments

comments powered by Disqus