Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson16_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
5d72469f
authored
2 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
28a9d7fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
diy1.py
diy1.py
View file @
5d72469f
import
random
import
random
class
Hero
(
object
):
class
Hero
(
object
):
def
__init__
(
self
,
name
):
def
__init__
(
self
,
name
):
self
.
name
=
name
self
.
name
=
name
...
@@ -45,7 +44,18 @@ print(" 战斗开始")
...
@@ -45,7 +44,18 @@ print(" 战斗开始")
while
True
:
while
True
:
print
(
"-"
*
30
)
print
(
"-"
*
30
)
l
=
input
(
'请选择技能(1为攻击/2为治疗):'
)
l
=
input
(
'请选择技能(1为攻击/2为治疗):'
)
if
l
==
'
q
'
:
if
l
==
'
p
'
:
print
(
"游戏结束"
)
print
(
"游戏结束"
)
break
break
elif
l
==
'1'
:
houyi
.
cure
()
elif
l
==
'2'
:
houyi
.
combat
(
yase
)
else
:
print
(
"请重新选择技能"
)
continue
n
=
random
.
randint
(
1
,
3
)
if
n
==
1
:
yase
.
cure
()
else
:
yase
.
combat
(
houyi
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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