电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

C++编写的“扫雷”源程序

C++编写的“扫雷”源程序_第1页
1/7
C++编写的“扫雷”源程序_第2页
2/7
C++编写的“扫雷”源程序_第3页
3/7
第 7 页精品文档---下载后可任意编辑C++编写的“扫雷”源程序 1、//headerfile#includeiostream#includecstdlib#includectime#includewindows.h#includeconio.h//defines#defineKEY_UP0xE048#defineKEY_DOWN0xE050#defineKEY_LEFT0xE04B#defineKEY_RIGHT0xE04D#defineKEY_ESC0x001B#defineKEY_11#defineKEY_22#defineKEY_33#defineGAME_MAX_WIDTH100#defineGAME_MAX_HEIGHT100//StringsResource#defi 2、neSTR_GAMETITLEArrowKey:MoveCursorKey1:OpenKey2:MarkKey3:OpenNeighbors#defineSTR_GAMEWINCongratulations!YouWin!Thankyouforplaying!n#defineSTR_GAMEOVERGameOver,thankyouforplaying!n#defineSTR_GAMEENDPresentedbyyzfy.PressESCtoexitn//-------------------------------------------------------------//Baseclassclas 3、sCConsoleWnd{public:staticintTextOut(constchar*);staticintGotoXY(int,int);staticintCharOut(int,int,constint);staticintTextOut(int,int,constchar*);staticintGetKey();public:};//{{//classCConsoleWnd////intCConsoleWnd::GetKey()//WaitforstandardinputandreturntheKeyCode//intCConsoleWnd::GetKey(){intnkey=getch(),nk= 4 、 0;if(nkey=128||nkey==0)nk=getch();returnnk0?nkey*256+nk:nkey;}////intCConsoleWnd::GotoXY(intx,inty)//第 8 页精品文档---下载后可任意编辑Movecursorto(x,y)//OnlyConsoleApplication//intCConsoleWnd::GotoXY(intx,inty){COORDcd;cd.X=x;cd.Y=y;returnSetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),cd);}////intCConsoleWnd::TextOut(constchar*pstr 5、)//Outputastringatcurrentposition//intCConsoleWnd::TextOut(constchar*pstr){for(;*pstr;++pstr)putchar(*pstr);return0;}////intCConsoleWnd::CharOut(intx,inty,constintpstr)//Outputacharat(x,y)//intCConsoleWnd::CharOut(intx,inty,constintpstr){GotoXY(x,y);returnputchar(pstr);}////intCConsoleWnd::TextOut(constchar*p 6、str)//Outputastringat(x,y)//intCConsoleWnd::TextOut(intx,inty,constchar*pstr){GotoXY(x,y);returnTextOut(pstr);}//}}//-------------------------------------------------------------//ApplicationclassclassCSLGame:publicCConsoleWnd{private:private:intcurX,curY;intpoolWidth,poolHeight;intbm_gamepool[GAME_MAX_HEIGHT 7、+2][GAM...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

C++编写的“扫雷”源程序

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部