Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-1-1_DIY1
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1b01315d
authored
Jul 26, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
e72ed877
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
3260 deletions
diy1.py
s.py
diy1.py
View file @
1b01315d
...
@@ -13,3270 +13,82 @@
...
@@ -13,3270 +13,82 @@
# pen.end_fill()
# pen.end_fill()
# pen.hideturtle()
# pen.hideturtle()
# turtle. done()
# turtle. done()
import
random
#
import random
player
=
input
(
"请输出:拳头/剪刀/布:"
)
#
player=input("请输出:拳头/剪刀/布:")
print
(
"玩家出拳:"
+
player
)
#
print("玩家出拳:"+player)
list
=
[
'拳头'
,
'剪刀'
,
'布'
]
#
list=['拳头','剪刀','布']
computer
=
random
.
choice
(
list
)
#
computer=random.choice(list)
print
(
"计算机出拳:"
+
computer
)
#
print("计算机出拳:"+computer)
if
player
in
list
:
#
if player in list:
# if player==computer:
# if player==computer:
# print("平局!")
# print("平局!")
# if(player=='拳头' and computer == '剪刀')or (player=='剪刀 ' and computer=='布') or (player=='布' and computer== '拳头'):
# if(player=='拳头' and computer == '剪刀')or (player=='剪刀 ' and computer=='布') or (player=='布' and computer== '拳头'):
# print("玩家赢了!")
# print("玩家赢了!")
# else:
# else:
# print('计算机赢了!')
# print('计算机赢了!')
if
player
==
computer
:
# if player==computer:
print
(
"平局!"
)
# print("平局!")
elif
(
player
==
'拳头'
and
computer
==
'剪刀'
)
or
(
player
==
'剪刀 '
and
computer
==
'布'
)
or
(
player
==
'布'
and
computer
==
'拳头'
):
# elif(player=='拳头' and computer == '剪刀')or (player=='剪刀 ' and computer=='布') or (player=='布' and computer== '拳头'):
print
(
"玩家赢了!"
)
# print("玩家赢了!")
else
:
# else:
print
(
'计算机赢了!'
)
# print('计算机赢了!')
# import turtle
else
:
# pen=turtle.Pen()
# pen.pensize(3)
# pen.pencolor("red")
# pen.fillcolor("red")
# pen.begin_fill()
# pen.left(45)
# pen.forward(200)
# pen.circle(100,180)
# pen.right(90)
# pen.circle(100,180)
# pen.forward(200)
# pen.end_fill()
# pen.penup()
# pen.goto(100,-100)
# pen.pendown()
# pen.pencolor('black')
# pen.write("大家好,我叫利斯龙",font=('草书',30,'normal'))
# pen.hideturtle()
# turtle.done()
# import turtle
# pen=turtle.Pen()
# pen.left(45)
# pen.forward(200)
# pen.left(90)
# pen.circle(100,180)
# pen.left(90)
# pen.circle(100,180)
# pen.left(90)
# pen.forward(200)
# pen.hideturtle()
# turtle.done()
import
turtle
pen
=
turtle
.
Pen
()
def
ORing
(
a
,
b
,
color
):
pen
.
pencolor
(
color
)
pen
.
pensize
(
-
1
·
)
pen
.
penup
()
pen
.
goto
(
a
,
b
)
pen
.
pendown
()
pen
.
circle
(
40
)
ORing
(
-
100
,
50
,
"blue"
)
ORing
(
-
15
,
50
,
"black"
)
ORing
(
70
,
50
,
"red"
)
ORing
(
-
60
,
-
10
,
"yellow"
)
ORing
(
25
,
-
10
,
"green"
)
pen
.
hideturtle
()
turtle
.
done
()
# username='it'
# userpassword="345678900"
# while True:
# name = input("账号")
# password=input("密码")
# if name == username and password== userpassword:
# print("成功")
# continue
# if password != userpassword:
# print("错误")
# print("欢迎")
12
,
s.py
0 → 100644
View file @
1b01315d
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment