Commit aafdfb06 by BellCodeEditor

auto save

parent b53f7618
Showing with 159 additions and 9 deletions
import turtle as t
from turtle import *
import random as r
import time
def drawlight():
if r.randint(0,30) == 0:
color('tomato')
circle(6)
elif r. randint(0,30) == 1:
color('orange')
circle(3)
else:
linewidth = 5
color('dark green')
def tree(d,s):
if d <= 0: return
forward(5)
tree(d-1,s * 0.8)
right(120)
tree(d-3,s * 0.5)
drawlight()
right(120)
tree(d-3,s * 0.5)
right(120)
backward(s)
def xzs():
for i in range(200):
a = 200-400* r.random()
b = 10-20* r.random()
up()
forward(b)
left(90)
forward(a)
down()
if r.randint(0,1) == 0:
color('tomato')
else:
color('wheat')
circle(2)
up
backward(a)
right(90)
backward(b)
def drawsnow():
t.hideturtle()
t.pensize(2)
for i in range(200):
t.pencolor("white")
t.penup()
t.setx(r.randint(-350,350))
t.sety(r.randint(-100,350))
t.pendown()
dens = 6
snowsize = r.randint(1,10)
for j in range(dens):
t.forward(int(snowsize))
t.backward(int(snowsize))
t.right(int(360/dens)
n = 100
t.pensize(10)
speed("fastest")
t.screensize(800,600,"black")
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")
t.color("dark red","red")
t.write("Merry christmas",align="center",font=("comic Sans Ms",40,"bold"))
drawsnow()
t.done()
import turtle as t
t.setheading(180)
t.color("green")
t.begin_fill()
t.penup()
t.goto(50,50)
t.pendown()
for i in range(3):
t.forward(200)
t.right(120)
t.end_fill()
t.penup()
t.setheading(180)
t.goto(50,0)
t.pendown()
t.color("green")
t.begin_fill()
for i in range(3):
t.forward(200)
t.right(120)
t.end_fill()
t.penup()
t.setheading(180)
t.goto(50,-50)
t.pendown()
t.color("green")
t.begin_fill()
for i in range(3):
t.forward(200)
t.right(120)
t.end_fill()
t.color("dark red","red")
t.write("Merry christmas",align="center",font=("comic Sans Ms",40,"bold"))
t.setheading(100)
t.penup()
t.goto(-23,160)
t.pendown()
t.color("yellow")
t.begin_fill()
for i in range(5):
t.forward(100)
t.left(144)
t.end_fill()
t.done()
......@@ -4,15 +4,16 @@ import random
list=["石头","剪刀","布"]
computer=random.choice(list)
if player == computer:
print("平局")
elif player=="石头"and computer=="剪刀":
print("恭喜你赢了")
elif player=="剪刀"and computer=="布":
print("恭喜你赢了")
elif player=="布"and computer=="石头":
print("恭喜你赢了")
if player in list:
if player == computer:
print("平局")
elif (player=="石头"and computer=="剪刀")or(player=="剪刀"and computer=="布")or(player=="布"and computer=="石头"):
print("恭喜你赢了")
else:
print("抱歉,很遗憾你输了")
else:
print("抱歉,很遗憾你输了")
print("输入错误")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment