版本比较
地图迷宫
正文
增加 4 行删除 4 行
274 行未改动全部展开275276277278279280281282283284285286703 行未改动全部展开99099199299399499599699799828 行未改动274 行未改动全部展开pos.x = MAP_SIZE - 1 - i; // 确保不重复pos.y = MAP_SIZE - 1 - i;break;}} while (calculateDistance(player, pos) <= MIN_INIT_DISTANCE ||!isConnected(player, pos) ||isPositionOccupied(pos)); // 新增:检查是否被其他鬼魂占用// 初始化鬼魂状态ghosts[i].pos = pos;ghosts[i].frozen = 0;ghosts[i].dead = 0;703 行未改动全部展开case 's': case 'S': movePlayer(0, 1); break;case 'a': case 'A': movePlayer(-1, 0); break;case 'd': case 'D': movePlayer(1, 0); break;case ' ': movePlayer(0, 0); break; // 等待case 'q': case 'Q':printf("\n\n👋 游戏已退出!\n");return;default:strcpy(lastMsg, "❌ 输入无效!请使用 W/S/A/D/空格/Q 或数字键!");28 行未改动274 行未改动全部展开275276277278279280281282283284285286703 行未改动全部展开99099199299399499599699799828 行未改动274 行未改动全部展开pos.x = MAP_SIZE - 1 - i; // 确保不重复pos.y = MAP_SIZE - 1 - i;break;}} while (calculateDistance(player, pos) <= MIN_INIT_DISTANCE ||!isConnected(player, pos) ||isPositionOccupied(pos)); // 新增:检查是否被其他鬼魂占用// 初始化鬼魂状态ghosts[i].pos = pos;ghosts[i].frozen = 0;ghosts[i].dead = 0;703 行未改动全部展开case 's': case 'S': movePlayer(0, 1); break;case 'a': case 'A': movePlayer(-1, 0); break;case 'd': case 'D': movePlayer(1, 0); break;case ' ': movePlayer(0, 0); break; // 等待case 'q': case 'Q':printf("\n\n👋 游戏已退出!\n");return;default:strcpy(lastMsg, "❌ 输入无效!请使用 W/S/A/D/空格/Q 或数字键!");28 行未改动