Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson14_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
507936d7
authored
Jun 07, 2025
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
6f2012f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
7 deletions
1.py
diy2.py
1.py
0 → 100644
View file @
507936d7
import
turtle
pen
=
turtle
.
Pen
()
screen
=
turtle
.
Screen
()
pen
.
fillcolor
(
"white"
)
pen
.
begin_fill
()
pen
.
forward
(
200
)
pen
.
left
(
90
)
pen
.
forward
(
200
)
pen
.
left
(
90
)
pen
.
forward
(
200
)
pen
.
left
(
90
)
pen
.
forward
(
200
)
pen
.
left
(
90
)
pen
.
end_fill
()
pen
.
hideturtle
()
turtle
.
done
()
\ No newline at end of file
diy2.py
View file @
507936d7
...
@@ -4,9 +4,13 @@ class Hero:
...
@@ -4,9 +4,13 @@ class Hero:
self
.
name
=
name
self
.
name
=
name
self
.
hp
=
hp
self
.
hp
=
hp
self
.
attack
=
attack
self
.
attack
=
attack
yase
=
Hero
(
'yase'
,
300
,
20
)
def
upgrade
():
#升级
houyi
=
Hero
(
'houyi'
,
250
,
23
)
yase
.
level
=
yase
.
level
+
1
caihong
=
Hero
(
'caihong'
,
5600
,
199
)
yase
.
hp
=
yase
.
hp
+
50
print
(
yase
.
attack
)
yase
.
attack
=
yase
.
attack
+
10
print
(
houyi
.
attack
)
yase
=
Hero
(
"亚瑟"
,
300
,
20
)
print
(
caikong
.
attack
)
print
(
'亚瑟的初始血量'
,
yase
.
hp
)
\ No newline at end of file
upgrade
()
upgrade
()
upgrade
()
print
(
'亚瑟的升级血量'
,
yase
.
hp
)
\ 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