第 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,constcha