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

正文內(nèi)容

五子棋游戲程序設(shè)計(jì)與開發(fā)-閱讀頁(yè)

2024-12-26 01:33本頁(yè)面
  

【正文】 RegisterClass amp。 BOOL InitInstance HINSTANCE hInstance, int nCmdShow HMENU hMenu。//加載菜單 //定義窗口 hWnd CreateWindow szAppName, // 指向已注冊(cè)的類名 TEXT 歡樂(lè)五子棋 , // 窗口標(biāo)題 WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, //窗口樣式 400, // 初始化 x 坐標(biāo) 150, // 初始化 y 坐標(biāo) 709, // 初始化窗口寬度 593, // 初始化窗口高度 NULL, // 父窗口句柄 hMenu, // 窗口菜單句柄 hInstance, // 程序?qū)嵗浔? NULL // 創(chuàng)建參數(shù) 。 hAccel LoadAccelerators hInstance, LPCTSTR IDR_MENU1 。//顯示窗口 SW_SHOW UpdateWindow hWnd 。 static int over 0。 //當(dāng)前實(shí)例句柄 static int xArray[16*16][2]。 //總局?jǐn)?shù) int whiteWin 0。 //黑方獲勝次數(shù) //long __stdcall WndProc void *,unsigned int,unsigned int,long //回調(diào)函數(shù)一般由系統(tǒng)調(diào)用,如 Wndproc 函數(shù) LRESULT CALLBACK WndProc HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam PAINTSTRUCT ps。 //定義設(shè)備句柄 HDC hdcMem。 static HBITMAP hBitmap, hBitmap1,hBitmap2,hBitmap3。 static int cxSource, cySource。 static int site 2。 static bool t true。 HBRUSH hBr。 //定義一個(gè)迭代子 //std::list ::iterator ptr。 //xArray 數(shù)組的坐標(biāo)值 static bool CtrlS true。 //InitChessBr 。 //初始化棋盤 //InvalidateRect hwnd,NULL,0 。 //開始人機(jī)對(duì)弈 MessageBox hwnd,開發(fā)中 ...,敬請(qǐng)期待 !,游戲提示 ,0 。 break。 //數(shù)組歸位 InitChessBr 。 //初始化棋盤 InvalidateRect hwnd,NULL,0 。 //開始雙人游戲 else if over 2 MessageBox hwnd,游戲正在進(jìn)行中,如需要請(qǐng)選擇重 新開始! ,游戲提示 ,0 。 case ID_MRESTART: //重新開始游戲 if over 1||over 2 px 0。 //清空 List 鏈表 。 //刷新 窗口 else if over 0 MessageBox hwnd,本局已經(jīng)結(jié)束,請(qǐng)選擇開始游戲! ,游戲提示 ,0 。 case ID_MRESET: //刷新記分牌 if over 0 whiteWin 0。 //黑方獲勝記錄清零 px 0。 //清空 List 鏈表中的棋子信息 。 //刷新窗口 else MessageBox hwnd,本局結(jié) 束后,才能重新計(jì)分! ,游戲提示 ,0 。 case ID_MREPENT: //悔棋功能 if over ! 0 if InitChessB ! 0 if t //悔棋后重新設(shè)置黑白棋子和指示牌標(biāo)志位 t false。 else t true。 px。 //得到棋子的橫坐標(biāo)值 n xArray[px][1]。 //將該棋子的 位置信息置為空 [m][n].color 0。 //從 List 表中刪除棋子信息 else MessageBox hWnd,棋盤都空啦,還能悔棋嗎?重新開始吧 ,游戲提示 ,0 。 //加入棋子聲音 InvalidateRect hwnd,NULL,0 。 break。 else CtrlS true。 case ID_MEXIT: //退 出游戲 SendMessage hwnd,WM_DESTROY,0,0 。 case ID_MHOUJUE: //聯(lián)系作者 DialogBox hInstance, LPCTSTR IDD_DIALOG1, hwnd, About 。 case ID_MHELP: //游戲幫助 DialogBox hInstance, LPCTSTR IDD_DIALOG4, hwnd, About 。 break。 。 hBitmap LoadBitmap hInstance, LPCTSTR IDB_BITMAP1 。 //加載背景圖片 GetObject hBitmap, sizeof BITMAP , amp。 cxSource 。 break。 N HIWORD lParam 。amp。amp。amp。 j int floor double N100 / 22 。 //解決了連續(xù) 2 個(gè)同色的小 bug! if [i][j].GetTag 0 //判斷此位置是否為空白 [i][j].settag 1 。 //1為黑子 site 1。 InvalidateRect hwnd,NULL,0 。 //2為白子 site 0。 InvalidateRect hwnd,NULL,0 。 ////over 1 為人機(jī)對(duì)弈 ///// if over 1 if M 16 amp。 M 16+22*17 amp。 N 100 amp。 N 100+22*17 //定位十字位置 i int floor double N100 / 22 。 else return 0。 InitChessB_back [i][j] 。 xArray[px][1] j。 else px 0。amp。 //加入棋子聲音 break。ps 。 bufferDC CreateCompatibleDC hdc 。//創(chuàng)建緩沖位圖 SelectObject bufferDC,hBitmap2 。 BitBlt bufferDC, 0, 0, 709, 540, hdcMem, 0, 0, SRCCOPY 。 BitBlt bufferDC, 0, 75, cxSource19, cySource, hdcMem, 0, 0, SRCCOPY 。i 17。j 17。 iter ! InitChessB 。amp。 else if iter GetTag 1 amp。 iter Getcolor 2 BitBlt bufferDC, iter , iter , 20, 19, hdcMem, cxSource20, 0, SRCCOPY 。//為了避免刷新屏幕導(dǎo)致屏幕閃爍, //從內(nèi)存緩沖區(qū)中 BufferDC 整體讀到窗口中; if hInstance,hwnd 1 //判斷勝負(fù) 1 為黑方勝, 2 為白方 blackWin++。 //一方勝利后結(jié)束本局 if CtrlS PlaySound TEXT Sound\\ ,NULL,SND_FILENAME|SND_ASYNC 。 //白方勝利次數(shù)自加 1 over 0。 //加入棋子聲音 count blackWin + whiteWin。 //自定義字體 和 hFont HFONT hFont。LogFont, 0, sizeof LOGFONT 。 0。 0。 lstrcpy ,隸書 。LogFont 。 SetBkMode hdc, TRANSPARENT 。 TextOut hdc,70,10,TEXT 歡樂(lè)五子棋 ,10 。 LOGFONT LogFont1。 memset amp。 26。 0。 GB2312_CHARSET。 hFont1 CreateFontIndirect amp。 SelectObject hdc,hFont1 。//SetTextColor hdc,RGB rand %356,rand %256,rand %156 。 else if site 0 TextOut hdc,140,510,請(qǐng)黑方選手下棋 ...,17 。 else if over 0 if count 0 TextOut hdc,140,510,黑方先手下棋 ,12 。amp。 t false。 else if count 1 amp。 hInstance,hwnd 2 TextOut hdc,95,510,白方選手勝利 下輪白方先手 ,26 。 site 1。amp。 t true。 else if count%2 0 amp。 hInstance,hwnd 2 TextOut hdc,95,510,白方選手勝利 下輪黑方先手 ,26 。 site 0。amp。 t false。 else if count%2 1 amp。 hInstance,hwnd 2 TextOut hdc,95,510,白方選手勝利 下輪白方先手 ,26 。 site 1。 itoa whiteWin, buffer1, 10 。 //如果是第一局,則總局?jǐn)?shù)顯示為 1 itoa count, buffer2, 10 。 TextOut hdc,588,136,buffer,2 。 TextOut hdc,529,301,buffer,2 。 TextOut hdc,651,137,0,1 。 DeleteObject hFont1 。 DeleteDC bufferDC 。 EndPaint hwnd, amp。 break。 br
點(diǎn)擊復(fù)制文檔內(nèi)容
研究報(bào)告相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1