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
12b5ed5e
authored
Sep 24, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
ce44dbd8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
3 deletions
diy2.py
qqdz
qqdz.py
diy2.py
View file @
12b5ed5e
...
...
@@ -22,9 +22,11 @@ class Hero: # 英雄类
exit
()
class
Player
():
# 玩家英雄
def
__init__
(
self
,
name
):
???
class
Player
(
Hero
):
# 玩家英雄
def
__init__
(
self
):
super
()
.
__init__
(
self
,
name
)
self
.
hp
=
200
self
.
attack
=
50
player
=
Player
(
"后羿"
)
...
...
qqdz
0 → 100644
View file @
12b5ed5e
import random
wu=["武装直升机","防空导弹","坦克","战略核武器","高超音速导弹","特种部队","主战坦克连"]
w=["武装直升机","防空导弹","坦克"]
player=input("普通武器:武装直升机/防空导弹/坦克 超级武器:战略核武器/高超音速导弹/特种部队/主战坦克连,您派出:")
print("............")
print("红方派出"+player)
yyl=random.choice(w)
print("蓝方派出"+yyl)
print("............")
if player in wu:
if player == yyl:
print("红方"+player+"和蓝方"+yyl+"实力相当")
print("红蓝平局")
elif (player=="武装直升机" and yyl=="坦克") or (player=="坦克" and yyl=="防空导弹") or (player=="防空导弹" and yyl=="武装直升机"):
print("红方获胜")
print("红方"+player+"打掉了蓝方"+yyl)
elif (player=="战略核武器"):
print("红方全面胜利")
print("一朵红色蘑菇云升起,战略核武器炸平了蓝方整个国家,曹嘉兴国不复存在")
elif (player=="高超音速导弹"):
print("红方全面胜利")
print("一发高超音速导弹直接打到敌方基地,敌方军事力量直接溃败。")
elif (player=="特种部队"):
print("红方全面胜利")
print("一支经验丰富的特种小组借着夜色进入敌方基地,敌方军事基地的人员全被击杀。")
elif (player=="主战坦克连"):
print("红方全面胜利")
print("一列99A型主战坦克冲向敌方营地,几炮就把敌方基地炸成废墟。")
else:
print("蓝方获胜")
print("红方"+player+"被蓝方"+yyl+"打掉了")
else:
print("我方没有此类武器。")
\ No newline at end of file
qqdz.py
0 → 100644
View file @
12b5ed5e
import
random
wu
=
[
"武装直升机"
,
"防空导弹"
,
"坦克"
,
"战略核武器"
,
"高超音速导弹"
,
"特种部队"
,
"主战坦克连"
]
w
=
[
"武装直升机"
,
"防空导弹"
,
"坦克"
]
player
=
input
(
"普通武器:武装直升机/防空导弹/坦克 超级武器:战略核武器/高超音速导弹/特种部队/主战坦克连,您派出:"
)
print
(
"............"
)
print
(
"红方派出"
+
player
)
yyl
=
random
.
choice
(
w
)
print
(
"蓝方派出"
+
yyl
)
print
(
"............"
)
if
player
in
wu
:
if
player
==
yyl
:
print
(
"红方"
+
player
+
"和蓝方"
+
yyl
+
"实力相当"
)
print
(
"红蓝平局"
)
elif
(
player
==
"武装直升机"
and
yyl
==
"坦克"
)
or
(
player
==
"坦克"
and
yyl
==
"防空导弹"
)
or
(
player
==
"防空导弹"
and
yyl
==
"武装直升机"
):
print
(
"红方获胜"
)
print
(
"红方"
+
player
+
"打掉了蓝方"
+
yyl
)
elif
(
player
==
"战略核武器"
):
print
(
"红方全面胜利"
)
print
(
"一朵红色蘑菇云升起,战略核武器炸平了蓝方整个国家,曹嘉兴国不复存在"
)
elif
(
player
==
"高超音速导弹"
):
print
(
"红方全面胜利"
)
print
(
"一发高超音速导弹直接打到敌方基地,敌方军事力量直接溃败。"
)
elif
(
player
==
"特种部队"
):
print
(
"红方全面胜利"
)
print
(
"一支经验丰富的特种小组借着夜色进入敌方基地,敌方军事基地的人员全被击杀。包括曹某"
)
elif
(
player
==
"主战坦克连"
):
print
(
"红方全面胜利"
)
print
(
"一列99A型主战坦克冲向敌方营地,几炮就把敌方基地炸成废墟。"
)
else
:
print
(
"蓝方获胜"
)
print
(
"红方"
+
player
+
"被蓝方"
+
yyl
+
"打掉了"
)
else
:
print
(
"我方没有此类武器。"
)
\ 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