Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson15_3
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
7032163d
authored
Sep 08, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
a18fe985
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
diy2.py
diy3.py
diy2.py
View file @
7032163d
...
...
@@ -65,7 +65,7 @@ player1 = Player("后羿",200,5)
player2
=
Player
(
"亚瑟"
,
200
,
5
)
while
True
:
print
(
'='
*
35
)
user_input
=
str
(
input
(
'请选择英雄技能(1:攻击,2:回血,3:挖矿):'
))
user_input
=
str
(
input
(
'请选择英雄技能(1:攻击,2:回血,3:挖矿
,4:升级
):'
))
if
user_input
==
"1"
:
player1
.
combat
(
player2
)
if
player2
.
hp
>
50
:
...
...
@@ -74,29 +74,37 @@ while True:
player2
.
cure
()
elif
user_input
==
"2"
:
player1
.
cure
()
if
random
.
randint
(
0
,
1
)
==
0
:
if
random
.
randint
(
0
,
2
)
==
0
:
if
player2
.
level
>=
5
:
player2
.
wk
()
else
:
player2
.
cure
()
elif
random
.
randint
(
0
,
2
)
==
1
:
player2
.
combat
(
player1
)
else
:
player2
.
sj
()
elif
user_input
==
"3"
:
player1
.
wk
()
if
random
.
randint
(
0
,
1
)
==
0
:
if
random
.
randint
(
0
,
2
)
==
0
:
if
player2
.
level
>=
5
:
player2
.
wk
()
else
:
player2
.
cure
()
el
se
:
el
if
random
.
randint
(
0
,
2
)
==
1
:
player2
.
combat
(
player1
)
else
:
player2
.
sj
()
elif
user_input
==
"4"
:
player1
.
sj
()
if
random
.
randint
(
0
,
1
)
==
0
:
if
random
.
randint
(
0
,
2
)
==
0
:
if
player2
.
level
>=
5
:
player2
.
wk
()
else
:
player2
.
cure
()
el
se
:
el
if
random
.
randint
(
0
,
2
)
==
1
:
player2
.
combat
(
player1
)
else
:
player2
.
sj
()
else
:
print
(
'无效字符,请重新输入'
)
\ No newline at end of file
diy3.py
View file @
7032163d
a
=
[
1
,
2
,
3
,
4
,
5
]
print
(
a
)
a
.
append
(
12
)
print
(
a
)
\ No newline at end of file
class
\ 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