Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson15_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
4bb31a21
authored
Aug 29, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
77916180
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
diy1.py
diy1.py
View file @
4bb31a21
...
@@ -14,9 +14,20 @@ class Hero(object):
...
@@ -14,9 +14,20 @@ class Hero(object):
print
(
info
)
print
(
info
)
else
:
else
:
print
(
enemy
.
name
+
"阵亡了"
+
"游戏结束"
)
print
(
enemy
.
name
+
"阵亡了"
+
"游戏结束"
)
exit
()
#
exit()
yase
=
Hero
(
"垭瑟"
)
yase
=
Hero
(
"垭瑟"
)
houyi
=
Hero
(
"后羿"
)
houyi
=
Hero
(
"后羿"
)
for
i
in
range
(
9
):
for
i
in
range
(
9
):
yase
.
combat
(
houyi
)
yase
.
combat
(
houyi
)
class
Player
(
Hero
):
def
__init__
(
self
,
name
,
type
):
super
()
.
__init__
(
name
)
self
.
hp
=
200
self
.
attack
=
50
self
.
type
=
type
print
(
"成功创建角色"
+
self
.
name
+
"它的生命有"
+
str
(
self
.
hp
)
+
"它的攻击力是"
+
str
(
self
.
attack
))
abc
=
Player
(
"yase"
,
"sheshou"
)
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