Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson15_3
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
1426dac8
authored
Feb 07, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
01bd0d50
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletions
diy2.py
diy2.py
View file @
1426dac8
...
...
@@ -41,7 +41,24 @@ class Player(Hero): # 玩家英雄
houyi
=
Player
(
"后羿"
,
"射手"
)
hero
=
Hero
(
"s"
)
import
random
while
True
:
print
(
"-"
*
30
)
chioce
=
input
(
'请选择攻击/治疗术1/2:'
)
choice
=
input
(
'请选择攻击/治疗术1/2:'
)
if
choice
==
'1'
:
houyi
.
combat
(
hero
)
elif
choice
==
'2'
:
houyi
.
cure
()
elif
choice
==
'q'
:
break
else
:
print
(
'请重新输入1/2:'
)
continue
num
=
random
.
randint
(
1
,
2
)
if
num
==
"1"
:
hero
.
combat
(
houyi
)
if
num
==
"2"
:
hero
.
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