c语言飞行棋
后颈部疼痛-
#include
#include
char
map[10][81]=
{
━═━═━★¤═━■═━═★━═━★═━〓═━¤═〓━■═━═
┃
║
★
┃
═
p>
═★〓━═█━═━═¤━═━═★━═━═〓━═━═¤━★═━
┃
║
┃
¤═━〓
═━═━═━═━★═━¤═━═━〓═〓━═■★━═━
═
<
/p>
int step1=0,step2=0;//
玩家
1
,
2
的步数;
char
p[6][30]={
成
龙
李连杰
李小龙
吴
京
洪金宝
不赋值
int step[101]={0};//
等价于
memset(step,0,101*sizeof(int));
int compare(int
t,int i,int j)
{
int f,change;
if
(step[t]==0)
{
p>
printf(
您目前在普通的位置上
,<
/p>
您在第
%d
个格上
n
return 0;
}
else
if (step[t]==1)
{
printf(
您已到达幸运转盘
(
★
),
您在第
%d
个格上
n
p
rintf(
您有
2
重选择:
1.
与
%s
交换位置,
2.
轰炸
%sn
printf(
请
选
择
序
号
:
scanf(
if (f==1)
{
change=step1;
step1=step2;
step2=change;
printf(
交
换
成
功
!
n
return 0;
}
else
{
if (step1==t)
{
step2=0;
}
else
{
step1=0;
}
printf(
轰
炸
成
功
!
n
return 0;
}
}
else if(step[t]==2)
{
printf(
恭喜您!顺
利
踩
到
炸
p>
弹
(
¤
)
!被炸回
6
个格
...n
if
(step1==t)
{
if
(step1<=6)
{
step1=0;
}
else
{
step1=step1-6;
}
}
else
{
if (step2<=6)
{
step2=0;
}
else
{
step2=step2-6;
}
}
return 0;
}
else
if(step[t]==3)
{
printf(
恭喜您!您已到
%d
个格
(
■
)
,您可以休息一回合啦
...n<
/p>
return 1;
}
else
{
printf(
< br>替你难过!你怎么能用时光隧道
(
〓
)
呢
?!...
算了
,
你
!
赢了
...n
return 2;
}
}
void fight()
{
int p1,p2,i;//
玩家
1
,
2
;
p>
printf(
两
人
对
战
!~~~~~~~~~~~~~n
printf(
游
戏
人
物
:n
printf(
for
(i=1;i<6;i++)
{
printf(
}
printf(
printf(
请
选
择
角
色
:n<
/p>
printf(
请
玩
家
1
选
择<
/p>
(
对应序号
)
:
scanf(
printf(
请
玩
家
2
选
择<
/p>
(
对应序号
)
:
scanf(
show_map()
;//
飞行棋地图;
handle(p1,p2);
}
//Handle.h
void handle(int
m,int n)
{
int e=0,g=0,dic
e,c1=0,c2=0;//dice
是掷骰子数
,e
接受返回参数
,c
计数变量
< br>
step[6]=step[14]=step[18]=s
tep[34]=step[39]=step[51]=step[65]=step[82]=step[9
6]=1;//
五
星由
1
代表;
step[7]
=step[41]=step[56]=step[24]=step[70]=step[85]=2;//
¤代表
2
step[10]=step[28]=step[61]=step[95]=3;//
■代表
3
step[21]=s
tep[26]=step[46]=step[64]=step[73]=step[90]=step[9
2]=4;//
〓代表
4
;
printf(
游
戏
开
始
:n
while (step1<100&&step2<100)