Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-1-2_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
0e616ea6
authored
Nov 21, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
80472840
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
star.py
star.py
View file @
0e616ea6
sb
=
input
(
"出什么?"
)
sb
=
input
(
"出什么?"
)
#询问玩家输入的内容
print
(
"你出"
+
sb
)
print
(
"你出"
+
sb
)
#输出玩家输入的内容
import
random
#调用随机函数
import
random
com
=
[
"石头"
,
"剪刀"
,
"布"
]
#列表赋值
com
=
[
"石头"
,
"剪刀"
,
"布"
]
sss
=
random
.
choice
(
com
)
#让人机随机输入
sss
=
random
.
choice
(
com
)
print
(
"人机出了"
+
sss
)
#输出人机的输入
print
(
"人机出了"
+
sss
)
if
sb
in
com
:
#判断是否输入错误
if
sb
==
sss
:
if
sb
==
sss
:
#判断是否平局
print
(
"平局,奥利给"
)
print
(
"平局,奥利给"
)
elif
(
sss
==
"石头"
and
sb
==
"剪刀"
)
or
(
sss
==
"剪刀"
and
sb
==
"布"
)
or
(
sss
==
"布"
and
sb
==
"石头"
)
:
elif
(
sss
==
"石头"
and
sb
==
"剪刀"
)
or
(
sss
==
"剪刀"
and
sb
==
"布"
)
or
(
sss
==
"布"
and
sb
==
"石头"
)
:
#判断玩家是否输了
print
(
"你输了,雪————花———飘—飘"
)
print
(
"你输了,雪————花———飘—飘"
)
else
:
#判断玩家是否赢了
print
(
"妈妈,我咗的啦"
)
else
:
else
:
print
(
"妈妈,我咗的啦"
)
print
(
"大憨憨!输错了!你上过九年义务教育吗?"
)
\ No newline at end of file
\ No newline at end of file
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