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
c00085b3
authored
Dec 19, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
76106d53
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
diy1.py
diy1.py
View file @
c00085b3
import
random
list
=
[
"石头"
,
"剪刀"
,
"布"
]
player1
=
input
(
"玩家出拳(石头/剪刀/布)"
)
print
(
"玩家出拳:"
+
player1
)
list
=
[
"石头"
,
"剪刀"
,
"布"
]
player2
=
random
.
choice
(
list
)
print
(
"赌怪卢本伟向你发起石头剪刀布挑战:"
+
random
.
choice
(
list
))
if
player1
==
player2
:
if
player1
in
list
:
player2
=
random
.
choice
(
list
)
print
(
"赌怪卢本伟向你发起石头剪刀布挑战:"
+
random
.
choice
(
list
))
if
player1
==
player2
:
print
(
"平局,不错"
)
elif
(
player1
==
"石头"
and
player
==
"剪刀"
)
or
(
player1
==
"布"
and
player2
==
"石头"
)
and
(
player1
==
"剪刀"
and
player2
==
"布"
):
elif
(
player1
==
"石头"
and
player
==
"剪刀"
)
or
(
player1
==
"布"
and
player2
==
"石头"
)
and
(
player1
==
"剪刀"
and
player2
==
"布"
):
print
(
"你赢了,赌怪表示不服,并想要与你再来一次"
)
else
:
else
:
print
(
"你输了,惩罚是吃掉你自己的电脑"
)
else
:
print
(
"因为你在直播间散播不符合“石头剪刀布”比赛规则的相关行为,已将你逐出“赌怪卢本伟”的直播间"
)
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