画一个Android智能手机机器人

画一个Android智能手机机器人,效果如下图

要求:

1.身体颜色为green

2.眼睛直径30

3.天线长度30

4.身体是长方形,长:160,宽:120

5.腿长度43

6.手臂长度65

参考代码

复制代码
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)
相关推荐
BFT白芙堂15 分钟前
Franka & DROID :面向真实场景的机器人操作数据集
人工智能·学习·机器学习·机器人·具身智能·franka·robotiq
数据知道1 小时前
PHP 代码审计实战——ThinkPHP、Laravel 历史漏洞模式深度剖析
android·网络·web安全·网络安全·php·laravel
拍客圈2 小时前
换服务器 mozcjpeg 5.0.0
android
千里码aicood2 小时前
基于PyQt心理咨询机器人智能系统的设计与实现
机器人·pyqt
梦想的旅途22 小时前
企业微信智能客服机器人:API二次开发实战
机器人·企业微信
恒锐丰小瑞3 小时前
率能SS6285M 33V/5.5A/单通道直流电机驱动IC,低待机功耗与多重保护,用于电子锁/玩具/机器人
stm32·单片机·嵌入式硬件·机器人
蜡台3 小时前
Jetpack Compose 稳定性、重组优化(Stable / @NonRestartableComposable)
android·kotlin·compose·jepack
__Witheart__3 小时前
3588 Android 13 预装apk失败 —— 不再使用apps.mk
android
__Witheart__3 小时前
3588 Android 串口软件提示“没有串口读写权限”
android