惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
Blog — PlanetScale
Blog — PlanetScale
GbyAI
GbyAI
MongoDB | Blog
MongoDB | Blog
月光博客
月光博客
The Cloudflare Blog
量子位
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog
MyScale Blog
MyScale Blog
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
G
Google Developers Blog
D
DataBreaches.Net
V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
U
Unit 42
博客园 - 聂微东
有赞技术团队
有赞技术团队
A
About on SuperTechFans

博客园 - 子墨老师

画一个红色灯笼 画一个哆啦A梦 画一个小黄人 画一个太极八卦图 基于Hutool的poi导出excel表格【升级更新】 如何设置wps单元格下拉选项设置 Caused by: org.jasypt.exceptions.EncryptionOperationNotPossibleException: Encryption raised an exception ZoomIt的使用与快捷键 springboot项目中使用Java 8的日期时间API 基于springboot系统,如何跟踪会话过期,浏览器会话标识是否收到正常响应,存储,并在后续请求保持携带 SpringBoot+MyBatis实现数据库字段加密 Vue2中能否实现输入中文自动转化为拼音, 且不带音调 Excel导出问题:accessExternalStylesheet 解构赋值+扩展运算符在数组和对象上的应用例子 收藏一下JDK下载地址 介绍几个axios接口请求顺序的问题 vue cli的介绍 Failed to start nginx.service: Unit nginx.service not found. 如何实现文件批量重命名后再进行批量打包下载 如何能成功在centos7下安装nodejs18+以上版本 centos7下卸载nodejs源码包 基于ConcurrentMap锁机制的NFS文件合并方案 基于ConcurrentMap锁机制的NFS分片上传方案 如何将已经存在的本地项目源码关联到远程git仓库中 gitee如何使用 centos7安装php+wordpress
画一个Android智能手机机器人
子墨老师 · 2026-08-26 · via 博客园 - 子墨老师

画一个Android智能手机机器人,效果如下图
 
要求:
1.身体颜色为green
2.眼睛直径30
3.天线长度30
4.身体是长方形,长:160,宽:120
5.腿长度43
6.手臂长度65

image

参考代码

import turtle

#头
turtle.color('green')
turtle.forward(160)
x = turtle.xcor()
turtle.setheading(90) #向左旋转90°
turtle.begin_fill()
turtle.circle(x/2, 180) #半圆脑袋
turtle.end_fill()
turtle.penup()
turtle.goto(33,37)
turtle.pendown()
turtle.dot(13,'black') #左眼
turtle.penup()
turtle.goto(126,37)
turtle.pendown()
turtle.dot(13,'black') #右眼
turtle.penup()
turtle.home()
turtle.pendown()

#脑袋左上角天线
turtle.forward(160)
turtle.setheading(90) #向左旋转90°
turtle.circle(x/2,120)
turtle.right(90)
turtle.pensize(5)
turtle.forward(30)

#脑袋右上角天线
turtle.penup()
turtle.home()
turtle.forward(160)
turtle.setheading(90)
turtle.circle(x/2,60)
turtle.right(90)
turtle.pendown()
turtle.forward(30)
turtle.penup()
turtle.home()
turtle.pendown()

#身体
turtle.penup()
turtle.goto(0,-7)
turtle.pendown()
turtle.begin_fill()
turtle.forward(160) #上横线
turtle.right(90)
turtle.forward(120) #右横线
turtle.right(90)
turtle.forward(160) #下横线
turtle.right(90)
turtle.forward(120) #左横线
turtle.end_fill()

#腿
turtle.penup()
turtle.goto(33, -169)
turtle.pendown()
turtle.pensize(32)
turtle.forward(43) #画左腿
turtle.penup()
turtle.goto(130, -169)
turtle.pendown()
turtle.forward(43) #画右腿

#手
turtle.pensize(30)
turtle.penup()
turtle.goto(-18,0)
turtle.pendown()
turtle.right(180)
turtle.forward(65)
turtle.penup()
turtle.goto(179,0)
turtle.pendown()
turtle.forward(65)