How to think like a Computer Scientist: 课后习题第三章 12题


import turtle
import time


wn = turtle.Screen()
wn.bgcolor("green")
wn.title("yuxiangyang is testing!")


alex = turtle.Turtle()
alex.shape("turtle")
alex.color("navy blue")
alex.speed(0)
alex.penup()
alex.stamp()


for i in range(12):
    alex.left(i*30)
    alex.forward(100)
    alex.stamp()
    alex.forward(-100)
    alex.right(i*30)


tess = turtle.Turtle()
tess.color("navy blue")
tess.pensize(4)
tess.speed(0)
tess.penup()


for i in range(12):
    tess.left(i*30)
    tess.forward(70)
    tess.pendown()
    tess.forward(15)
    tess.penup()
    tess.forward(-85)
    tess.right(i*30)
    
time.sleep(10)
wn.bye()



C o py r ig ht (C ) 1 9 9 9 Alle n B . Dow ne y T his b o o k is a n O p e n So ur c e Te x tb o o k (O ST ). Pe r mis s io n is g r ante d to r e pr o -duc e , s to r e o r tr a ns mit the te x t o f this b o o k by a ny me a ns , e lec tr ic a l, me cha n-ic a l, o r bio lo g ic a l, in a c c o r da nc e w ith the te r ms o f the GNU Ge ne r a l P ublic L ic e ns e a s publis he d by the Fr e e So ftwa r e Fo unda tio n (ve r s io n 2 ). T his b o o k is dis tr ibute d in the ho p e tha t it w ill b e us e ful, but WI T HO UT ANY WARRANT Y; w itho ut e ve n the implie d wa r r a nty o f ME RC HANTAB IL I T Y o r FI T NE SS FO R A PART I C UL AR P URP O SE . Se e the GNU Ge ne r a l P ublic L ic e ns e fo r mo r e de ta ils . T he o r ig ina l fo r m o f this b o o k is L a Te X s o ur c e c o de . C o mpiling this L a Te X s o ur c e ha s the e ffe c t o f g e ne r a ting a de v ic e - inde p e nde nt r e pr e s e nta tio n o f a te x tb o o k , w hich c a n b e c o nve r te d to o the r fo r ma ts a nd pr inted. All inte r me dia te r e pr e s e nta tio ns (inc luding DVI a nd Po s ts c r ipt), a nd a ll printe d c o pie s o f the te x tb o o k a r e a ls o c ove r e d by the GNU Ge ne r a l P ublic L ic e ns e . T he L a Te X s o ur c e fo r this b o o k , a nd mo r e info r ma tio n a b o ut the O p e n So ur c e Te x tb o o k pr o je c t, is ava ila ble fr o m h t t p : / / w w w . c s . c ol by . ed u/ ~ do wn e y/ os t o r by w r iting to Alle n B . Dow ne y, 5 8 5 0 May flowe r Hill, Wa te r v ille , ME 0 4 9 0 1 . T he GNU Ge ne r a l P ublic L ic e ns e is ava ila ble fr o m w w w .g nu.o rg o r by w r iting to the Fr e e So ftwa r e Fo unda tio n, I nc ., 5 9 Te mple P la c e - Suite 3 3 0 , B o s to n, MA 0 2 1 1 1 - 1 3 0 7 , USA. T his b o o k wa s ty p e s e t by the a utho r us ing L a Te X a nd dv ips , w hich a r e b o th fr e e , o p e n- s o ur c e pr o g r a ms .
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值