利用Python画一只小猪佩奇
# 小朱 # 时间:2022/3/7 19:30 # coding=utf-8import turtle as tt.pensize(4) t.hideturtle() t.colormode(255) t.color((255, 155, 192), "pink") t.setup(840, 500) t.speed(10) # 佩奇的鼻子 t.pu() t.goto(-100, 100) t.pd() t.seth(-30) t.begin_fill() a = 0.4 for i in range(120):if 0 <= i < 30 or 60 <= i < 90:a = a + 0.08t.lt(3) # 向左转3度t.fd(a) # 向前走a的步长else:a = a - 0.08t.lt(3)t.fd(a) t.end_fill() t.pu() t.seth(90) t.fd(25) t.seth(0) t.fd(10) t.pd() t.pencolor(255, 155, 192) t.seth(10) t.begin_fill() t.circle(5) t.color(160, 82, 45) t.end_fill() t.pu() t.seth(0) t.fd(20) t.pd() t.pencolor(255, 155, 192) t.seth(10) t.begin_fill() t.circle(5) t.color(160, 82, 45) t.end_fill() # 佩奇的头 t.color((255, 155, 192), "pink") t.pu() t.seth(90) t.fd(41) t.seth(0) t.fd(0) t.pd() t.begin_fill() t.seth(180) t.circle(300, -30) t.circle(100, -60) t.circle(80, -100) t.circle(150, -20) t.circle(60, -95) t.seth(161) t.circle(-300, 15) t.pu() t.goto(-100, 100) t.pd() t.seth(-30) a = 0.4 for i in range(60):if 0 <= i < 30 or 60 <= i < 90:a = a + 0.08t.lt(3) # 向左转3度t.fd(a) # 向前走a的步长else:a = a - 0.08t.lt(3)t.fd(a) t.end_fill() # 佩奇的耳朵 t.color((255, 155, 192), "pink") t.pu() t.seth(90) t.fd(-7) t.seth(0) t.fd(70) t.pd() t.begin_fill() t.seth(100) t.circle(-50, 50) t.circle(-10, 120) t.circle(-50, 54) t.end_fill()t.pu() t.seth(90) t.fd(-12) t.seth(0) t.fd(30) t.pd() t.begin_fill() t.seth(100) t.circle(-50, 50) t.circle(-10, 120) t.circle(-50, 56) t.end_fill()# 佩奇的卡姿兰大眼睛 t.color((255, 155, 192), "white") t.pu() t.seth(90) t.fd(-20) t.seth(0) t.fd(-95) t.pd() t.begin_fill() t.circle(15) t.end_fill()t.color("black") t.pu() t.seth(90) t.fd(12) t.seth(0) t.fd(-3) t.pd() t.begin_fill() t.circle(3) t.end_fill()t.color((255, 155, 192), "white") t.pu() t.seth(90) t.fd(-25) t.seth(0) t.fd(40) t.pd() t.begin_fill() t.circle(15) t.end_fill()t.color("black") t.pu() t.seth(90) t.fd(12) t.seth(0) t.fd(-3) t.pd() t.begin_fill() t.circle(3) t.end_fill()# 腮红 t.color((255, 155, 192)) t.pu() t.seth(90) t.fd(-95) t.seth(0) t.fd(65) t.pd() t.begin_fill() t.circle(30) t.end_fill()# 微笑唇 t.color(239, 69, 19) t.pu() t.seth(90) t.fd(15) t.seth(0) t.fd(-100) t.pd() t.seth(-80) t.circle(30, 40) t.circle(40, 80) # 身体 t.color("red", (255, 99, 71)) t.pu() t.seth(90) t.fd(-20) t.seth(0) t.fd(-78) t.pd() t.begin_fill() t.seth(-130) t.circle(100, 10) t.circle(300, 30) t.seth(0) t.fd(230) t.seth(90) t.circle(300, 30) t.circle(100, 3) t.color((255, 155, 192), (255, 100, 100)) t.seth(-135) t.circle(-80, 63) t.circle(-150, 24) t.end_fill() # 手 t.color((255, 155, 192)) t.pu() t.seth(90) t.fd(-40) t.seth(0) t.fd(-27) t.pd() t.seth(-160) t.circle(300, 15) t.pu() t.seth(90) t.fd(15) t.seth(0) t.fd(0) t.pd() t.seth(-10) t.circle(-20, 90)t.pu() t.seth(90) t.fd(30) t.seth(0) t.fd(237) t.pd() t.seth(-20) t.circle(-300, 15) t.pu() t.seth(90) t.fd(20) t.seth(0) t.fd(0) t.pd() t.seth(-170) t.circle(20, 90)#jiojio t.pensize(10) t.color((240, 128, 128)) t.pu() t.seth(90) t.fd(-75) t.seth(0) t.fd(-180) t.pd() t.seth(-90) t.fd(40) t.seth(-180) t.color("black") t.pensize(15) t.fd(20)t.pensize(10) t.color((240, 128, 128)) t.pu() t.seth(90) t.fd(40) t.seth(0) t.fd(90) t.pd() t.seth(-90) t.fd(40) t.seth(-180) t.color("black") t.pensize(15) t.fd(20)# 尾巴 t.pensize(4) t.color((255, 155, 192)) t.pu() t.seth(90) t.fd(70) t.seth(0) t.fd(95) t.pd() t.seth(0) t.circle(70, 20) t.circle(10, 330) t.circle(70, 30) # 作者:小朱 t.pencolor('lightgray') t.goto(230, -160) t.write("小猪佩奇", font=('Arial', 12, 'bold italic')) t.goto(230, -180) t.write("zj", font=('Arial', 12, 'bold italic')) t.done()
利用Python画一只小猪佩奇相关推荐
- Python画海绵宝宝、小猪佩奇、皮卡丘
文章目录 海绵宝宝 小猪佩奇 皮卡丘 海绵宝宝 效果图: 学姐的代码: from turtle import *def go_to(x, y):penup()goto(x, y)pendown()de ...
- c语言画一只小猪佩奇
/* 小猪佩奇 */ #include <math.h> #include <stdio.h> #include <stdlib.h> #define T doub ...
- 用python画小动物代码_python用turtle画一只小猪佩奇,并打包为exe
from turtle import * importtimedef nose(x, y): #鼻子 penup() #提起笔 goto(x, y) #定位 pendown() #落笔,开始画 set ...
- 趣味Python之旅之画一只小猪佩奇
这是课上老师给我们演示的代码,出处不明 据说是一位国外大佬的杰作.与大家共勉,一起探索编程(秃头)的乐趣. 先上图: 代码奉上. #!/usr/bin/env python2 # coding=utf ...
- python画彩色_用python画彩色的小猪佩奇
# !/usr/bin/env python2 # coding=utf-8 import turtle as t t.pensize(4) t.hideturtle() t.colormode(25 ...
- 用python画气球_用python画彩色的小猪佩奇
# !/usr/bin/env python2 # coding=utf-8 import turtle as t t.pensize(4) t.hideturtle() t.colormode(25 ...
- 用c语言编程画一只猪,如何优雅的使用C语言绘制一只小猪佩奇
今天我们来用C语言画一只小猪佩奇---社会.社会.... 在画小猪佩奇之前,我们先使用带符号的距离长 (signed distance field,SDF) 来画一个圆形. 使用这个方法表示形状,但是 ...
- c语言画猪程序,C/C++知识点之如何优雅的使用C语言绘制一只小猪佩奇
本文主要向大家介绍了C/C++知识点之如何优雅的使用C语言绘制一只小猪佩奇,通过具体的内容向大家展示,希望对大家学习C/C++知识点有所帮助. 今天我们来用C语言画一只小猪佩奇---社会.社会.... ...
- 如何优雅的使用C语言绘制一只小猪佩奇
今天我们来用C语言画一只小猪佩奇---社会.社会.... 在画小猪佩奇之前,我们先使用带符号的距离长 (signed distance field,SDF) 来画一个圆形. 使用这个方法表示形状,但是 ...
最新文章
- 单片机串口输入c语言,单片机通过串口与电脑连接通信C语言源代码
- Android获取SDK的版本信息
- JUnit和hamcrest的jar包关系
- DTCC 2020 | 阿里云梁高中:DAS之基于Workload的全局自动优化实践
- python列表写入字典_python – 将列表字典写入CSV文件
- 2012最新75款好看的英文字体免费下载【中篇】
- java id自增_Java分布式自增长ID实现方案
- eclipse你的主机中的软件中止了一个已建立的连接。_如何备份/恢复一个基于Windows系统的操作面板?...
- python有道-Python爬去有道翻译
- Vue SEO解决方案
- INS-13001环境不满足最低要求
- DWR入门教程(http://www.cnblogs.com/cyjch/archive/2012/02/16/2353758.html)
- Vue写的一个网站项目
- C语言数据结构--线性表
- java web程序课后答案_JavaWeb程序设计教程课后练习答案【参考】.doc
- 【车间调度】FJSP的属性模型符号约定和约束条件
- 万得数据写入Excel
- 河南科技学院教务管理系统服务器,河南科技学院教务管理系统http://jwgl.hist.edu.cn/jwweb/...
- “药药切克闹”系列-基于STM32触摸屏的超级无敌智能电子密码锁(仿手机键盘26键设计,密码支持英文大写+英文小写+数字)
- 模电精髓“200问”
热门文章
- 广播发送者广播接收者介绍
- 动手学习深度学习——Pytorch版教程系列汇总(长期更新版)
- Web前端——JSP
- 赛灵思 Xilinx UG1506 - Versal ACAP 开发板系统设计方法指南(中文版) (v2021.2)
- [024] 微信公众帐号小q机器人实例.
- WinEdt的bib参考文献管理教程
- EOF while reading packet
- 电感器的正确测量电感同BuH的关系
- 编程求一个9位的整数,数字由1-9构成,每个数字只能出现一次。并且这个整数的前一位能被1整除,前两位能被2整除, ......以此类推,前九位能被9整除。
- 进度条媒体对象和Well组件