基本信息
源码名称:python绘制七巧板
源码大小:1.13KB
文件格式:.py
开发语言:Python
更新时间:2019-10-05
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
用python绘制出七巧板
# 绘制三角形函数 def triangle(a, col): begin_fill() for i in range(1): fd(a) rt(135) fd(a * sqrt(2)) rt(135) fd(a) fillcolor(col) end_fill() rt(180) # 绘制正方形函数 def square(b, col): begin_fill() for i in range(4): fd(b) rt(90) fillcolor(col) end_fill() rt(180) # 绘制菱形函数 def diamond(c, col): begin_fill() for i in range(2): fd(c) rt(135) fd(sqrt(2) * c) rt(45) fillcolor(col) end_fill()