迷宫问题,用数组方式实现一个迷宫
答案:1 悬赏:70 手机版
解决时间 2021-05-16 07:02
- 提问者网友:山高云阔
- 2021-05-15 19:19
迷宫问题,用数组方式实现一个迷宫
最佳答案
- 五星知识达人网友:动情书生
- 2021-05-15 19:51
网上随便拉的!#include <graphics.h>#include <stdlib.h>#include <stdio.h>#include <conio.h>#include <dos.h>#define N 20int oldmap[N][N];int yes=0;int way[100][2],wayn=0;void Init(void);void Close(void);void DrawPeople(int *x,int *y,int n);void PeopleFind(int (*x)[N]);void WayCopy(int (*x)[N],int (*y)[N]);int FindWay(int (*x)[N],int i,int j);void MapRand(int (*x)[N]);void PrMap(int (*x)[N]);void Result(void);void Find(void);void NotFind(void);void main(void)void Init(void)void DrawPeople(int *x,int *y,int n) setfillstyle(SOLID_FILL,RED); bar(100+(*y)*15-6,50+(*x)*15-6,100+(*y)*15+6,50+(*x)*15+6);}void PeopleFind(int (*map)[N]) setfillstyle(SOLID_FILL,WHITE); bar(100+y*15-6,50+x*15-6,100+y*15+6,50+x*15+6); if(x==N-2&&y==N-2) yes=1; }void WayCopy(int (*oldmap)[N],int (*map)[N])int FindWay(int (*map)[N],int i,int j) map[i][j]=1; WayCopy(oldmap,map); if(oldmap[i+1][j+1]==0&&!yes) } WayCopy(oldmap,map); if(oldmap[i+1][j]==0&&!yes) } WayCopy(oldmap,map); if(oldmap[i][j+1]==0&&!yes) } WayCopy(oldmap,map); if(oldmap[i-1][j]==0&&!y
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯