Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-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
27dcfd2c
authored
Apr 17, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
17e936d7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
3 deletions
diy1.py
ee.py
ffg.py
diy1.py
View file @
27dcfd2c
a
=
input
(
"请出拳(石头/剪刀/布):"
)
print
(
"玩家出拳是:"
+
a
)
\ No newline at end of file
import
turtle
pen
=
turtle
.
Pen
()
pen
.
penup
()
pen
.
goto
(
100
,
-
100
)
pen
.
write
(
"你好,诺亿
\n
turtle真好用
\n
我会在画布上添加文字啦"
,
font
=
(
"Times"
,
20
,
"normal"
))
pen
.
hideturtle
()
pen1
=
turtle
.
Pen
()
pen1
.
pensize
(
10
)
pen1
.
pencolor
(
"pink"
)
pen1
.
left
(
45
)
pen1
.
forward
(
100
)
pen1
.
circle
(
50
,
180
)
pen1
.
right
(
90
)
pen1
.
circle
(
50
,
180
)
pen1
.
forward
(
100
)
turtle
.
done
()
ee.py
0 → 100644
View file @
27dcfd2c
class
Hero
:
def
__init__
(
self
,
name
,
hp
,
attack
):
self
.
level
=
1
self
.
name
=
name
# name:名字
self
.
hp
=
hp
self
.
attack
=
attack
# attack:攻击
def
upgrade
(
self
):
self
.
level
=
self
.
level
+
1
self
.
hp
=
self
.
hp
+
50
self
.
attack
=
self
.
attack
+
4
houyi
=
Hero
(
"后羿"
,
300
,
20
)
houyi
.
upgrade
()
print
(
" 等级:"
,
houyi
.
level
)
print
(
"血量:"
,
houyi
.
hp
)
print
(
"攻击力:"
,
houyi
.
attack
)
ffg.py
0 → 100644
View file @
27dcfd2c
class
Hero
:
def
__init__
(
self
,
name
,
hp
,
attack
):
self
.
leve1
=
1000000000000000000000000
self
.
hp
=
name
self
.
hp
=
hp
self
.
attack
=
attack
def
upgrade
():
yase
.
leve1
=
yase
.
leve1
+
1000000000000000000000000000000000000000
yase
.
hp
=
yase
.
hp
+
50000000000000000000000000000000000000000000000000000000000000
yase
.
attack
=
yase
.
attack
+
4000000000000000000000000000000000000000000000000000000000000000000000000000
yase
=
Hero
(
'baba'
,
30000000000000000000000000000000000000000000000
,
2000000000000000000000000000000000000000000000000000000
)
upgrade
()
upgrade
()
print
(
yase
.
hp
)
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