源码自取:
链接:https://pan.baidu.com/s/1OwQqnTbnEmN0sFmGnwxAZQ
提取码:rlrt
群:970353786
--来自百度网盘超级会员V3的分享
源码:
# coding=gbk
"""
作者:川川
@时间 : 2021/12/13 23:38
qun:970353786
"""
from turtle import *
import random
import time
n = 100.0
speed("fastest")
screensize(bg='seashell')
left(90)
forward(3 * n)
color("orange", "yellow")
begin_fill()
left(126)
for i in range(5):
forward(n / 5)
right(144)
forward(n / 5)
left(72)
end_fill()
right(126)
color("dark green")
backward(n * 4.8)
def tree(d, s):
if d <= 0: return
forward(s)
tree(d - 1, s * .8)
right(120)
tree(d - 3, s * .5)
right(120)
tree(d - 3, s * .5)
right(120)
backward(s)
tree(15, n)
backward(n / 2)
for i in range(200):
a = 200 - 400 * random.random()
b = 10 - 20 * random.random()
up()
forward(b)
left(90)
forward(a)
down()
if random.randint(0, 1) == 0:
color('tomato')
else:
color('wheat')
circle(2)
up()
backward(a)
right(90)
backward(b)
done()
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://blog.csdn.net/weixin_46211269/article/details/121917190
内容来源于网络,如有侵权,请联系作者删除!