Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson16_2
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
c85de5f3
authored
Jun 04, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
bd826128
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
20 deletions
diy1.py
diy1.py
View file @
c85de5f3
...
@@ -39,31 +39,24 @@ class Player(Hero):
...
@@ -39,31 +39,24 @@ class Player(Hero):
print
(
"="
*
30
)
print
(
"="
*
30
)
print
(
"战斗开始!"
)
print
(
"战斗开始!"
)
player
=
Player
(
"射手"
,
"后羿"
)
computer
=
Hero
(
"垭瑟"
)
while
True
:
while
True
:
print
(
"="
*
30
)
print
(
"="
*
30
)
choice
=
input
(
"1攻击/2治疗/Q(大:"
)
choice
=
input
(
"1攻击/2治疗/Q(大
写)挂机
:"
)
if
choice
==
"1"
:
if
choice
==
"1"
:
p
ass
p
layer
.
combat
(
computer
)
elif
choice
==
"2"
:
elif
choice
==
"2"
:
p
ass
p
layer
.
cure
()
elif
choice
==
"Q"
:
elif
choice
==
"Q"
:
break
()
pass
else
:
else
:
print
(
"只能选择一或二"
)
print
(
"只能选择一或二或Q"
)
continue
c_choice
=
random
.
randint
(
1
,
7
)
c_choice
=
random
.
randint
(
1
,
7
)
if
c_choice
<
3
:
if
c_choice
<
3
:
pass
computer
.
combat
(
player
)
else
:
else
:
pass
computer
.
cure
()
print
(
"="
*
30
)
\ No newline at end of file
houyi
=
Player
(
"射手"
,
"后羿"
)
yase
=
Hero
(
"垭瑟"
)
houyi
.
combat
(
yase
)
yase
.
combat
(
houyi
)
houyi
.
cure
()
yase
.
cure
()
\ 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