Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson16_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
d92c1114
authored
May 15, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
e5909ed0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
diy1.py
diy1.py
View file @
d92c1114
import
random
class
Hero
(
object
):
def
__init__
(
self
,
name
):
self
.
name
=
name
...
...
@@ -45,4 +46,27 @@ print(" 开始战斗")
while
True
:
print
(
'-'
*
30
)
juese
=
input
(
"请输入操作指令,1发起攻击。2是治疗血量"
)
\ No newline at end of file
if
juese
==
"q"
:
exit
elif
juese
==
1
:
print
(
'-'
*
30
)
combat
(
yase
)
elif
juese
==
2
:
print
(
'-'
*
30
)
cure
()
elif
juese
==
3
:
print
(
'-'
*
30
)
print
(
"你投降了"
)
break
else
:
print
(
"警报警报,无效字符报错"
)
continue
win
=
random
.
randint
(
1
,
3
)
if
win
==
1
:
yase
.
cure
()
else
:
combat
(
houyi
)
print
(
"菜"
)
exit
\ 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