Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson14_4
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
d540b5e6
authored
Jun 19, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
030e24ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
diy2.py
diy2.py
View file @
d540b5e6
...
@@ -4,15 +4,17 @@ class sans():
...
@@ -4,15 +4,17 @@ class sans():
self
.
HitPoint
=
HP
self
.
HitPoint
=
HP
self
.
Attack
=
AT
self
.
Attack
=
AT
self
.
Defense
=
DF
self
.
Defense
=
DF
def
self_check
(
a
):
print
(
str
(
a
.
Level
)
+
','
+
str
(
a
.
HitPoint
)
+
','
+
str
(
a
.
Attack
)
+
','
+
str
(
a
.
Defense
))
def
Level_Up
(
a
):
def
Level_Up
(
a
):
a
.
Level
+=
1
a
.
Level
+=
1
a
.
HitPoint
+=
1
a
.
HitPoint
+=
3
a
.
Attack
+=
1
a
.
Attack
+=
1
a
.
Defense
+=
1
a
.
Defense
+=
0.5
# def Check(a,):
# print('等级为'+str(a.Level)
# print('生命值为'+str(a.HitPoint))
# print('攻击力为'+str(a.Attack))
# print('防御力为'+str(a.Defense))
Sans
=
sans
(
1
,
1
,
1
)
Sans
=
sans
(
1
,
1
,
1
)
Sans
.
Level_Up
()
for
i
in
range
(
14
):
\ No newline at end of file
Sans
.
Level_Up
()
Sans
.
self_check
()
\ 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