Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson16_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
519702ec
authored
May 22, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
4b13facb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
diy1.py
diy1.py
View file @
519702ec
import
random
class
Hero
(
object
):
def
__init__
(
self
,
name
):
self
.
name
=
name
...
...
@@ -46,4 +47,22 @@ print('_ '*30)
print
(
' 战斗开始'
)
while
True
:
print
(
'_ '
*
30
)
input
(
'治疗术按1,攻击按2:'
)
\ No newline at end of file
ch
=
input
(
'治疗术按2,攻击按1:'
)
if
ch
==
'q'
:
print
(
'game 结束'
)
break
elif
ch
==
'1'
:
houyi
.
combat
(
yase
)
elif
ch
==
'2'
:
houyi
.
cure
()
else
:
print
(
"重新输入:"
)
continue
cnm
=
random
.
randin
(
1
,
3
)
if
cnm
==
1
:
yase
.
combat
(
houyi
)
else
:
yase
.
cure
()
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