Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson15_2_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
96a40dab
authored
Nov 13, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
9cbcb9f1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
5 deletions
2.py
3.py
diy2.py
test.py
2.py
0 → 100644
View file @
96a40dab
a
=
float
(
input
())
b
=
float
(
a
*
2
+
2
)
z
=
float
(
a
+
b
)
*
2
m
=
float
(
a
*
b
)
print
(
z
)
print
(
m
)
print
(
m
//
1
)
\ No newline at end of file
3.py
0 → 100644
View file @
96a40dab
import
turtle
pen
=
turtle
.
Pen
()
pen
.
down
()
for
i
in
range
(
3
):
pen
.
left
(
120
)
pen
.
forward
(
100
)
pen
.
up
()
pen
.
forward
(
120
)
pen
.
down
()
pen
.
left
(
120
)
pen
.
forward
(
150
)
pen
.
left
(
28
)
pen
.
forward
(
50
)
for
i
in
range
(
5
):
pen
.
forward
(
150
)
pen
.
left
(
70
)
pen
.
forward
(
50
)
pen
.
forward
(
-
50
)
turtle
.
done
()
diy2.py
View file @
96a40dab
...
@@ -7,6 +7,7 @@ class Hero: # 英雄类
...
@@ -7,6 +7,7 @@ class Hero: # 英雄类
self
.
max_hp
=
self
.
hp
self
.
max_hp
=
self
.
hp
def
combat
(
self
,
enemy
):
# 攻击功能
def
combat
(
self
,
enemy
):
# 攻击功能
info1
=
self
.
name
+
"对"
+
enemy
.
name
+
"发起进攻,"
info1
=
self
.
name
+
"对"
+
enemy
.
name
+
"发起进攻,"
info2
=
"造成"
+
str
(
self
.
attack
)
+
"点伤害,"
info2
=
"造成"
+
str
(
self
.
attack
)
+
"点伤害,"
...
@@ -25,15 +26,16 @@ class Hero: # 英雄类
...
@@ -25,15 +26,16 @@ class Hero: # 英雄类
class
Player
(
Hero
):
class
Player
(
Hero
):
def
__init__
(
self
,
name
):
def
__init__
(
self
,
name
):
# 玩家英雄
# 玩家英雄
super
()
.
__init__
(
name
)
super
(
Palyer
,
self
)
.
__init__
(
name
)
self
.
hp
=
200
self
.
hp
=
200
self
.
attack
=
50
self
.
attack
=
50
print
(
"玩家的血量值为:"
,
Player
.
hp
)
print
(
"玩家的攻击力为:"
,
Player
.
attack
)
houyi
=
Player
(
"后羿"
)
player
=
Player
(
"后羿"
)
#print("玩家的血量值为:",player.hp)
print
(
"玩家的血量值为:"
,
player
.
hp
)
#print("玩家的攻击力为:",player.attack)
print
(
"玩家的攻击力为:"
,
player
.
attack
)
test.py
0 → 100644
View file @
96a40dab
print
(
"hello world!"
)
\ 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