Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson6-1
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
3b25ec2c
authored
Feb 24, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
26b3b1d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
u.py
u.py
0 → 100644
View file @
3b25ec2c
_111_
=
0
_qq_
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
]
_kx_
=
0
#玩家
_WW_
=
0
#庄家
_kx1_
=
0
#玩家现拥有点数
_ww1_
=
0
#庄家现有有点数
import
random
print
(
"欢迎来到21点!"
)
_kx_
=
random
.
choice
(
_qq_
)
print
(
"以随机为你获取点数:"
+
str
(
_kx_
))
#kx_=int(_kx_)
print
(
"您现在拥有点数:"
+
str
(
_kx_
+
_kx1_
))
_ww_
=
random
.
choice
(
_qq_
)
print
(
"庄家现拥有点数:"
+
str
(
_ww_
+
_ww1_
))
_111_
=
input
(
"是否继续?(按0继续,任意键结束)"
)
while
True
:
if
_kx1_
<=
21
and
_ww1_
<=
21
:
if
_111_
==
"0"
:
_kx_
=
random
.
choice
(
_qq_
)
print
(
"以随机为你获取点数:"
+
str
(
_kx_
))
print
(
"您现在拥有点数:"
+
str
(
_kx_
+
_kx1_
))
_kx1_
=
_kx_
+
_ww_
=
random
.
choice
(
_qq_
)
print
(
"庄家现拥有点数:"
+
str
(
_ww_
+
_ww1_
))
_111_
=
input
(
"是否继续?(按0继续,任意键结束)"
)
else
:
if
_kx1_
==
_ww1_
:
print
(
"平局"
)
break
elif
_ww1_
>
_kx1_
:
print
(
"你输了"
)
break
else
:
print
(
"你赢了"
)
break
else
:
if
_kx1_
>
21
and
_ww1_
<=
21
:
print
(
"你输了"
)
break
if
_ww1_
>
21
and
_kx1_
<=
21
:
print
(
"你赢了"
)
break
if
_kx1_
>
21
and
_ww1_
>
21
:
print
(
"平局"
)
break
\ 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