資源簡(jiǎn)介
教孩子學(xué)編程源碼
代碼片段和文件信息
#?colorspiral.py
“““A?module?for?drawing?colorful?spirals?of?up?to?6?sides“““
import?turtle
def?cspiral(sides=6?size=360?x=0?y=0):
????“““Draws?a?colorful?spiral?on?a?black?background.
????Arguments:
????sides?--?the?number?of?sides?in?the?spiral?(default?6)
????size?--?the?length?of?the?last?side?(default?360)
????x?y?--?the?location?of?the?spiral?from?the?center?of?the?screen
????“““
????t=turtle.Pen()
????t.speed(0)
????t.penup()
????t.setpos(xy)
????t.pendown()
????turtle.bgcolor(“black“)
????colors=[“red“?“yellow“?“blue“?“orange“?“green“?“purple“]
????for?n?in?range(size):
????????t.pencolor(colors[n%sides])
????????t.forward(n?*?3/sides?+?n)
????????t.left(360/sides?+?1)
????????t.width(n*sides/100)
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-04-12?15:54??code\appendixC\
?????文件?????????750??2015-04-12?15:53??code\appendixC\colorspiral.py
?????文件?????????102??2015-04-12?15:53??code\appendixC\MultiSpiral.py
?????文件?????????257??2015-04-12?15:53??code\appendixC\SuperSpiral.py
?????目錄???????????0??2015-04-12?15:56??code\ch01\
?????文件?????????245??2015-04-12?13:54??code\ch01\Challenge1_MadLib.py
?????文件?????????285??2015-03-05?18:37??code\ch01\Challenge2_MadLib2.py
?????文件?????????265??2013-12-26?19:33??code\ch01\NiceHexSpiral.py
?????文件??????????76??2015-04-12?13:54??code\ch01\YourName.py
?????目錄???????????0??2015-04-12?15:59??code\ch02\
?????文件?????????400??2015-02-19?22:24??code\ch02\Challenge1_ColorSpiral10.py
?????文件?????????413??2014-11-01?12:19??code\ch02\Challenge2_ColorSpiralChoice.py
?????文件?????????305??2014-11-01?12:08??code\ch02\Challenge3_RubberBandBall.py
?????文件?????????113??2015-04-12?13:55??code\ch02\CircleSpiral1.py
?????文件?????????187??2015-04-12?13:57??code\ch02\ColorCircleSpiral.py
?????文件?????????356??2015-04-12?13:57??code\ch02\ColorSpiral.py
?????文件?????????171??2015-04-12?13:56??code\ch02\ColorSquareSpiral.py
?????文件?????????190??2015-02-08?12:50??code\ch02\ColorSquareSpiral2.py
?????文件?????????111??2013-12-27?10:45??code\ch02\SquareSpiral1.py
?????文件?????????110??2015-04-12?13:55??code\ch02\SquareSpiral2.py
?????文件?????????110??2015-04-12?13:56??code\ch02\SquareSpiral3.py
?????目錄???????????0??2015-04-12?15:59??code\ch03\
?????文件?????????829??2015-04-12?13:58??code\ch03\AtlantaPizza.py
?????文件?????????874??2015-04-02?17:10??code\ch03\Challenge1_CircleSpiralInput.py
?????文件????????1045??2015-02-01?16:53??code\ch03\Challenge2_ColorMeSpiralled.py
?????文件?????????874??2015-04-12?13:59??code\ch03\ColorSpiralInput.py
?????文件?????????485??2015-04-12?14:00??code\ch03\MathHomework.py
?????文件?????????266??2015-04-12?13:59??code\ch03\SayMyName.py
?????文件?????????837??2015-04-12?13:59??code\ch03\SpiralMyName.py
?????文件?????????302??2015-04-12?13:58??code\ch03\ThankYou.py
?????目錄???????????0??2015-04-12?16:01??code\ch04\
............此處省略83個(gè)文件信息
評(píng)論
共有 條評(píng)論