freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

走迷宮程序(含自動迷宮生成)(編輯修改稿)

2025-08-22 09:00 本頁面
 

【文章內容簡介】 setorigin(0, 0)。 // 顯示作者 SetWorkingImage()。 setcolor(BLUE)。 TCHAR author[] = _T(Powered by zhaoh1987@)。 outtextxy(471, 4, author)。 setcolor(LIGHTBLUE)。 outtextxy(470, 3, author)。}// 初始化游戲數據void InitGame(){ // 提示用戶輸入迷宮大小 GetMazeSize()。 // 初始化參數 if (g_imgMap != NULL) { // 清理迷宮地圖占用的內存 for(int x = 0。 x + 2。 x++) delete[] g_imgMap[x]。 delete [] g_imgMap。 } MakeMaze(, )。 // 創(chuàng)建迷宮 = 2。 // 設置游戲者的位置 = 2。 = 0。 // 設置視野范圍 = 0。 = 17。 = 13。 // 設置 GPS 顯示區(qū) setfillstyle(BLUE)。 bar(522, 368, 637, 471)。 if ( ) { = 100。 = (int)( * / + )。 } else { = 100。 = (int)( * / + )。 } Resize(amp。g_imgGPS, , )。 = 530 + 50 / 2。 = 370 + 50 / 2。 // 畫迷你地圖外框 setcolor(RED)。 rectangle( 1, 1, + , + )。 // 畫迷你地圖入口和出口 setcolor(YELLOW)。 moveto( 8, + / )。 linerel(7, 0)。 linerel(3, 3)。 moverel(3, 3)。 linerel(3, 3)。 moveto( + , + / )。 linerel(7, 0)。 linerel(3, 3)。 moverel(3, 3)。 linerel(3, 3)。 // 繪制游戲區(qū) Paint()。}// 提示用戶輸入迷宮大小void GetMazeSize(){ = = 0。 // 獲取用戶輸入的寬高 TCHAR s[4]。 while( 20 || 200) { InputBox(s, 4, _T(請輸入迷宮的寬度\n范圍:20~200), _T(輸入), _T(25))。 = _ttoi(s)。 } while( 20 || 200) { InputBox(s, 4, _T(請輸入迷宮的高度\n范圍:20~200), _T(輸入), _T(25))。 = _ttoi(s)。 } // 確保寬高為奇數 if ( % 2 != 1) ++。 if ( % 2 != 1) ++。}// 生成迷宮:初始化(注:寬高必須是奇數)void MakeMaze(int width, int height){ if (width % 2 != 1 || height % 2 != 1) return。 int x, y。 // 定義迷宮尺寸,并分配迷宮內存 g_imgMap = new BYTE*[width + 2]。 for(x = 0。 x width + 2。 x++) { g_imgMap[x] = new BYTE[height + 2]。 memset(g_imgMap[x], MAP_WALL, height + 2)。 } // 定義邊界 for (x = 0。 x = width + 1。 x++) g_imgMap[x][0] = g_imgMap[x][height + 1] = MAP_GROUND。 for (y = 1。 y = height。 y++) g_imgMap[0][y] = g_imgMap[width + 1][y] = MAP_GROUND。 // 定義入口和出口 g_imgMap[1][2] = MAP_ENTRANCE。 g_imgMap[width][height 1] = MAP_EXIT。 // 從任意點開始遍歷生成迷宮 TravelMaze(((rand() % (w
點擊復制文檔內容
數學相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1