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

正文內(nèi)容

五子棋游戲程序設(shè)計(jì)與開(kāi)發(fā)(參考版)

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

【正文】 return DefWind。 case WM_DESTROY: PostQuitMessage 0 。ps 。 ReleaseDC hWnd,hdc 。 DeleteDC hdcMem 。 TextOut hdc,651,302,0,1 。 TextOut hdc,30,510,buffer2,2 。 TextOut hdc,588,301,buffer1,2 。 TextOut hdc,529,136,buffer1,2 。 if count 0 count++。 itoa blackWin, buffer, 10 。 t false。amp。 site 1。 hInstance,hwnd 1 TextOut hdc,95,510,黑方選手勝 利 下輪白方先手 ,26 。 else if count%2 1 amp。 t true。amp。 site 0。 hInstance,hwnd 1 TextOut hdc,95,510,黑方選手勝利 下輪黑方先手 ,26 。 else if count%2 0 amp。 t false。amp。 site 1。 hInstance,hwnd 1 TextOut hdc,95,510,黑方選手勝利 下輪白方先手 ,26 。 else if count 1 amp。 count++。 ////游戲提示欄顯示邏輯 //// if over ! 0 if site 1 TextOut hdc,140,510,請(qǐng)白方選手下棋 ...,17 。 SetTextColor hdc,RGB 0,0,0 。LogFont1 。 lstrcpy ,隸書 。 0。 0。LogFont1, 0, sizeof LOGFONT 。 //自定義字體 和 hFont1 HFONT hFont1。 DeleteObject hFont 。//iMode 的值為 OPAQUE 文字矩形覆蓋背景 或 TRANSPARENT 文字背景透明 SetTextColor hdc,RGB rand %356,rand %256,rand %156 。 //創(chuàng)建字體 hFont SelectObject hdc,hFont 。 hFont CreateFontIndirect amp。 GB2312_CHARSET。 0。 55。 memset amp。//計(jì)算總局?jǐn)?shù) LOGFONT LogFont。 //一方勝利后結(jié)束本局 if CtrlS PlaySound TEXT Sound\\ ,NULL,SND_FILENAME|SND_ASYNC 。 //加入棋子聲音 else if hInstance,hwnd 2 whiteWin++。 //黑方勝利次數(shù)自加 1 over 0。 BitBlt hdc, 0, 0, cxSource+263, cySource+110, bufferDC, 0, 0, SRCCOPY 。amp。 iter Getcolor 1 BitBlt bufferDC, iter , iter , 20, 19, hdcMem, cxSource20, 19, SRCCOPY 。 iter++ if iter GetTag 1 amp。j++ for iter InitChessBn 。i++ for j 0。 for i 0。 SelectObject hdcMem, hBitmap 。 SelectObject hdcMem, hBitmap1 。 //創(chuàng)建 bufferDC 在內(nèi)存中加載數(shù)據(jù)后在顯示到屏幕,解決了屏幕閃爍問(wèn)題 hBitmap2 CreateCompatibleBitmap hdc,cxSource+263,cySource+110 。 hdcMem CreateCompatibleDC hdc 。 case WM_PAINT: //繪制窗口消息 hdc BeginPaint hwnd, amp。 CtrlS true PlaySound TEXT Sound\\ ,NULL,SND_FILENAME|SND_ASYNC 。 if over 2 amp。 px++。//將棋子信息存入 List 鏈表中 if px 255 //將二維數(shù)組坐標(biāo)值 i 和 j 存入 xArray 數(shù)組中,以便悔棋后進(jìn)行上一步棋子信息初始化 xArray[px][0] i。//解決了連續(xù) 2 個(gè)同色的小 bug! return 0。 j int floor double M32 / 22 。amp。amp。amp。 else if [i][j].GetTag 1 //不為空白就不能在此處下棋 return 0。 t true。 else [i][j].setcolor 2 。 //狀態(tài)顯示標(biāo)志 t false。 if t //實(shí)現(xiàn)黑白子循環(huán) t ture 為黑子先手 [i][j].setcolor 1 。 else return 0。 N 100+22*17 //定位棋盤十字坐標(biāo) i int floor double M32 / 22 。 N 100 amp。 M 16+22*17 amp。 ////over 2 為雙人游戲 ///// if over 2 if M 16 amp。 case WM_LBUTTONDOWN: //單擊鼠標(biāo)左鍵下棋 M LOWORD lParam 。 cySource 。bitmap 。 //加 載棋盤 hBitmap1 LoadBitmap hInstance, LPCTSTR IDB_BITMAP2 。 //窗口創(chuàng)建時(shí)初始化棋盤 hInstance LPCREATESTRUCT lParam hInstance。 case WM_CREATE: char buffer[99],buffer1[99],buffer2[198]。 break。 break。 break。 break。 case ID_SOUND: if CtrlS CtrlS false。 else MessageBox hWnd,您是要悔棋嗎?現(xiàn)在恐怕不行吧! ,游戲提示 ,0 。 PlaySound TEXT Sound\\ ,NULL,SND_FILENAME|SND_ASYNC 。 //將黑白標(biāo)志位置為空, InitChessBback 。 //得到棋子的縱坐標(biāo)值 [m][n].tag 0。 //數(shù)組標(biāo)志后退 1位 ,因?yàn)榛诘氖巧弦徊? m xArray[px][0]。 site 0。 site 1。 break。 //初始化棋盤 InvalidateRect hwnd,NULL,0 。 //數(shù)組歸位 InitChessBr 。 //白方獲勝記錄清零 blackWin 0。 break。 //初始化棋盤 InvalidateRect hwnd,NULL,0 。 //數(shù)組歸位 InitChessBr 。 break。 //刷新窗口 over 2。 //清空 List 鏈表 。 case ID_MDOUBLE: //雙人游戲模式 if over 0 px 0。 else MessageBox hwnd,游戲正在進(jìn)行中,如需要請(qǐng)選擇重新開(kāi)始! ,游戲提示 ,0 。 //over 1。 //清空 List 鏈表 // 。 switch message case WM_COMMAND: switch LOWORD wParam case ID_MSINGER: //單人游戲模式 if over 0 //px 0。 //定義一個(gè)迭代子 static int px 0。 std::list ::iterator iter。//黑白輪換標(biāo)志位, TRUE 為黑子 int m,n。//指示標(biāo)志位 static int M,N。 static int x,y,i,j。 BITMAP bitmap。 HDC bufferDC。 HDC hdc。 //白方獲勝次數(shù) int blackWin 0。 //設(shè)置二為數(shù)組 xArray,按順序記錄每一步棋子落點(diǎn)的二位數(shù)組坐標(biāo),用來(lái)在悔棋后初始化此落點(diǎn)的信息 int count 0。 //游戲模式標(biāo)志位 0 為空閑, 1 為人機(jī),2 為雙人 static HINSTANCE hInstance。//UpdateWindows 向窗口發(fā)送一條 WM_PAINT 消息,通知窗口更新其客戶區(qū) return TRUE。//加載快捷鍵表 ShowWindow hWnd,5 。 if !hWnd return FALSE 。//定義一個(gè)菜單句柄 hMenu LoadMenu hInstance, MAKEINTRESOURCE IDR_MENU1 。wndclass 。 szAppName。 HBRUSH GetStockObject WHITE_BRUSH 。 LoadIcon hInstance, CONST CHAR * IDI_ICON1 。 0。 WNDPROC WndProc。 BOOL InitApplication HINSTANCE hInstance WNDCLASS wndclass。 return 。//快捷鍵轉(zhuǎn)換 DispatchMessage amp。msg TranslateMessage amp。 while GetMessage amp。//消息結(jié)構(gòu) if !hPrevInstance if !InitApplication hInstance return FALSE 。 //定義快捷鍵表句柄 ChessBoard InitChessBoard。 //定義一個(gè)全局窗口句柄 static TCHAR szAppName[] TEXT Gobang 。 //主窗口過(guò)程聲明 BOOL CALLBACK About HWND hDig,UINT message,WPARAM wParam,LPARAM lPamam 。 BOOL InitInstance HINSTAN
點(diǎn)擊復(fù)制文檔內(nèi)容
研究報(bào)告相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1