『代码』··By/蜜汁炒酸奶

绘制自定义迷宫地图

/* 功能:绘制自定义迷宫地图 日期:2013-05-26 */ #include<stdio.h> #include<stdlib.h> #include<math.h> #define LEN 8 int main(void) { int A[LEN][LEN]={0}; int i,j; char ch1; //自定义wall printf(“Please input the picture of the wall:”); scanf(“%c”,&ch1); //输入map数组 printf(“Please input your map:(1 0)n”); for(i=0;i<LEN;i++) { for(j=0;j<LEN;j++) { scanf (“%1d”,&A[i][j]); } } //生成map printf(“Now drawing the map…n”); for(i=0;i<LEN;i++) { for(j=0;j<LEN;j++) { if(0==A[i][j]) { printf(“_”); } else if((1==A[i][j])) { printf(“%c”,ch1); } } printf(“n”); } system(“pause”); return 0; }

预览
Loading comments...
0 条评论

暂无数据

example
预览