Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson3-5-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
f4291f08
authored
Dec 03, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
fbd53b39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
2-16-diy1.py
2-16-diy1.py
View file @
f4291f08
import
random
class
Hero
(
object
):
class
Hero
(
object
):
def
__init__
(
self
,
name
):
def
__init__
(
self
,
name
):
self
.
name
=
name
self
.
name
=
name
...
@@ -45,7 +46,7 @@ while True:
...
@@ -45,7 +46,7 @@ while True:
a
=
input
(
'请选择技能:1攻击/2治疗'
)
a
=
input
(
'请选择技能:1攻击/2治疗'
)
if
int
(
a
)
==
1
:
if
int
(
a
)
==
1
:
houyi
.
combat
(
yase
)
houyi
.
combat
(
yase
)
elif
int
(
a
)
==
2
elif
int
(
a
)
==
2
:
houyi
.
cure
()
houyi
.
cure
()
elif
a
==
"q"
:
elif
a
==
"q"
:
print
(
'游戏结束'
)
print
(
'游戏结束'
)
...
@@ -53,7 +54,7 @@ while True:
...
@@ -53,7 +54,7 @@ while True:
else
:
else
:
print
(
"重输"
)
print
(
"重输"
)
continue
continue
b
=
rando
n
.
randint
(
1
,
3
)
b
=
rando
m
.
randint
(
1
,
3
)
if
b
==
3
:
if
b
==
3
:
yase
.
cure
()
yase
.
cure
()
else
:
else
:
...
...
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