全文预览

迷宫游戏C语言小游戏源代码

上传者:菩提 |  格式:doc  |  页数:16 |  大小:101KB

文档介绍
maze[curpos.x][curpos.y].mark==0)Рreturn TRUE;Рelse return FALSE;Р} /* Pass */Рvoid MarkPrint(PosType seat)Р/* Mark the position seat. */Р{Рmaze[seat.x][seat.y].mark=-1;Р/* Marking ''''''''''''''''''''''''''''''''-1'''''''''''''''''''''''''''''''' symbolize the current position cannot be put. */Р} /* MarkPrint */Рvoid FootPrint(PosType curpos)Р/* The foot of the curpos of the maze has been set ''''''''''''''''''''''''''''''''ue''''''''''''''''''''''''''''''''. */Р{Рmaze[curpos.x][curpos.y].foot=1;Р} /* FootPrint */РPosType NextPos(PosType seat,int di)Р{Рswitch(di)Р{Рcase 1: seat.y ; return seat; /* Eastward */Рcase 2: seat.x ; return seat; /* Southward */Рcase 3: seat.y--; return seat; /* Westward */Рcase 4: seat.x--; return seat; /* Northward */Рdefault: seat.x=0; seat.y=0; return seat;Р}

收藏

分享

举报
下载此文档