奇点星程
开始Python编程
海龟
作者:ng123
运行
清除
全屏运行
终端打印输出区
作品说明
一只海龟
点赞(0)
收藏 (0)
浏览量(7)
改编作品
我也要学编程
留 言
关于我们
奇点星程简介
用户协议
奇点星程官网
OJ平台
联系我们
微信:18065871965
邮箱:qidianxingcheng@163.com
建议反馈
软件下载
Scratch电脑版
Scratch安卓版
Python3.8
Dev-C++
管理平台
机构平台
校区平台
教师平台
©2017-2024. LLC. All RIGHTS RESERED.奇点星程
闽ICP备20003449号
闽公网安备35040302610058号
import turtle import math screen=turtle.Screen() screen.setup(800, 600) screen.title("绿海龟") screen.bgcolor("lightblue") t=turtle.Turtle() t.shape("turtle") t.speed(0) t.pensize(2) def ellipse(cx,cy,a,b,angle=0,pen="darkgreen",fill="green",n=72): rad = math.radians(angle) ca, sa = math.cos(rad), math.sin(rad) t.pencolor(pen) t.fillcolor(fill) pts = [] for i in range(n+1): th=2*math.pi*i/n x,y=a* math.cos(th),b*math.sin(th) pts.append((cx+x*ca-y*sa,cy+x*sa+y*ca)) t.penup() t.goto(pts[0]) t.pendown() t.begin_fill() for p in pts[1:]: t.goto(p) t.end_fill() SKIN="limegreen" SHELL="green" LINE="darkgreen" ellipse(-95,55,50,20,135,LINE,SKIN) ellipse(95,55,50,20,45,LINE,SKIN) ellipse(-78,-58,36,16,225,LINE,SKIN) ellipse(78,-58,36,16,-45,LINE,SKIN) t.pencolor(LINE) t.fillcolor(SKIN) t.penup() t.goto(-15,-85) t.pendown() t.begin_fill() t.goto(0,-128) t.goto(15,-85) t.goto(-15,-85) t.end_fill() ellipse(0,115,42,36,0,LINE,SKIN) for ex in (-16, 16): ellipse(ex,128,6,6,0,"black","black") t.pencolor(LINE) t.penup() t.goto(-10,92) t.pendown() for i in range(1,21): t.goto(-10+i,88-6 * math.sin(math.pi*i/20)) ellipse(0,0,115,92,0,LINE,SHELL) ellipse(0,0,82,65,0,LINE,"forestgreen") ellipse(0,0,42,33,0,LINE,SHELL) t.pencolor(LINE) for ang in range(0,360,60): r = math.radians(ang) t.penup() t.goto(42*math.cos(r),33*math.sin(r)) t.pendown() t.goto(82*math.cos(r),65*math.sin(r)) t.hideturtle() turtle.done() #是胡茂炯