#include <stdio.h>
#include <time.h>
#include <getch.h>
#include <stdlib.h>
int main(int argc ,const char* argv[])
{
// 定义迷宫地图
char maze[10][10] ={
{1,1,1,1,1,1,1,1,1,1},
{1,2,1,0,0,0,0,0,1,1},
{1,0,1,0,1,1,1,0,1,1},
{1,0,1,0,1,0,1,0,1,1},
{1,0,1,0,0,0,1,0,1,1},
{1,0,1,1,1,0,1,0,1,1},
{1,0,0,0,0,0,1,0,1,1},
{1,0,1,1,1,1,1,0,1,1},
{1,0,0,0,0,0,1,0,0,0},
{1,1,1,1,1,1,1,1,1,1},
};
// 定义老鼠坐标
int mouse_x = 1, mouse_y = 1;
// 获取开始时间
time_t start_time = time(NULL);
for(;;)
{
// 清理屏幕
system("clear");
for(int i=0; i<10; i++)
{
for(int j=0; j<10; j++)
{
switch(maze[i][j])
{
case 0: printf(" ");break;
case 1: printf("# ");break;
老鼠走迷宫(C语言实现)
最新推荐文章于 2022-05-04 23:59:19 发布