猫史档案馆


【Python作品分享】病毒曲线(第三代)-副本【作品秀】

用户:随风6ar_随风6ar_查看:0 回复:0 评论:0 创建时间:2021-10-24T12:09:11


【作品展示】

center_image

 

【作品介绍】

1

 

【作品源代码】

import turtle
import random
import random as r
import turtle as t


b = int(input('请选择颜色模式 1.随机 2.黑色 3,经典配色'))
b1 = int(input('选择线条模式 1,随机 2定数'))
if (b1 == 2):
    b2 = int(input('多少?'))
w1 = int(input('选择粗细模式(最大为十)'))
w2 = input('选择背景模式(输入颜色英文)')

a1 = 'red'
a2 = 'blue'
a3 = 'yellow'
a4 = 'orange'
a5 = 'purple'
a6 = 'pick'
a7 = 'black'
aa1 = [a1, a2, a3, a4, a5, a7, a7]
aa2 = [a1, a2, a3]
t.pensize(w1)
turtle.bgcolor(w2)
t.speed(0)
if (b == 1 and b1 == 1):
    q = random.randint(159, 567)
    a111 = 2
    for i in range(0, q):
        r1 = random.choice(aa1)
        t.pencolor(r1)
        t.forward(a111)
        t.right(91)
        a111 = (a111 + 1)

if (b == 2 and b1 == 1):
    q = random.randint(159, 567)
    a111 = 2
    for i in range(0, q):
        t.forward(a111)
        t.right(91)
        a111 = (a111 + 1)

if (b == 3 and b1 == 1):
    q = random.randint(159, 567)
    a111 = 2
    for i in range(0, q):
        r1 = random.choice(aa2)
        t.pencolor(r1)
        t.forward(a111)
        t.right(91)
        a111 = (a111 + 1)
if (b == 1 and b1 == 2):
    a111 = 2
    for i in range(0, b2):
        r1 = random.choice(aa1)
        t.pencolor(r1)
        t.forward(a111)
        t.right(91)
        a111 = (a111 + 1)

if (b == 2 and b1 == 2):
    a111 = 2
    for i in range(0, b2):
        t.forward(a111)
        t.right(91)
        a111 = (a111 + 1)

if (b == 3 and b1 == 2):
    a111 = 2
    for i in range(0, b2):
        r1 = random.choice(aa2)
        t.pencolor(r1)
        t.forward(a111)
        t.right(91)
        a111 = (a111 + 1)

turtle.done()

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页