Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-5_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
3e33c5e5
authored
Oct 24, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
174b28fa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
diy1.py
diy1.py
View file @
3e33c5e5
...
@@ -5,23 +5,30 @@ if player=="3":
...
@@ -5,23 +5,30 @@ if player=="3":
player
=
"布"
# 玩家出拳
player
=
"布"
# 玩家出拳
if
player
==
"2"
:
if
player
==
"2"
:
player
=
"剪刀"
player
=
"剪刀"
if
player
==
"9"
:
player
=
"二向箔"
if
player
==
"8"
:
player
=
"程心"
print
(
"玩家出:"
+
player
)
print
(
"玩家出:"
+
player
)
import
random
import
random
list
=
[
"石头"
,
"剪刀"
,
"布"
,
"二向箔"
,
"RPG"
,
"水滴"
,
"程心"
]
list
=
[
"石头"
,
"剪刀"
,
"布"
,
"二向箔"
,
"RPG"
,
"水滴"
,
"程心"
]
computer
=
random
.
choice
(
list
)
computer
=
random
.
choice
(
list
)
print
(
"电脑出:"
+
computer
)
print
(
"电脑出:"
+
computer
)
if
computer
==
player
:
if
player
in
list
:
if
computer
==
player
:
print
(
"平局"
)
print
(
"平局"
)
elif
player
==
"石头"
and
computer
==
"剪刀"
:
elif
player
==
"石头"
and
computer
==
"剪刀"
:
print
(
"恭喜,你赢了"
)
print
(
"恭喜,你赢了"
)
elif
player
==
"剪刀"
and
computer
==
"布"
:
elif
player
==
"剪刀"
and
computer
==
"布"
:
print
(
"恭喜,你赢了"
)
print
(
"恭喜,你赢了"
)
elif
player
==
"布"
and
computer
==
"石头"
:
elif
player
==
"布"
and
computer
==
"石头"
:
print
(
"恭喜,你赢了"
)
print
(
"恭喜,你赢了"
)
elif
comput
er
==
"二向箔"
:
elif
computer
==
"二向箔"
or
play
er
==
"二向箔"
:
print
(
"世界毁灭"
)
print
(
"世界毁灭"
)
elif
comput
er
==
"程心"
:
elif
computer
==
"程心"
or
play
er
==
"程心"
:
print
(
"宇宙消亡"
)
print
(
"宇宙消亡"
)
else
:
else
:
print
(
"你输了"
)
print
(
"你输了"
)
else
:
print
(
"输入错了"
)
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