資源簡介
本課題設(shè)計并實現(xiàn)了一個可以單人或雙人對戰(zhàn)的黑白棋游戲系統(tǒng),該系統(tǒng)采用C++語言在Microsoft Visual C++ 6.0下編寫代碼,采用VC中比較流行的MFC模板進(jìn)行編程。系統(tǒng)不僅使人進(jìn)行雙人對戰(zhàn)也可以進(jìn)行單人與計算機(jī)的對戰(zhàn),且人工智能比較高超。
系統(tǒng)主要功能包括:開始游戲,保存游戲,計算機(jī)演示,排行榜以及像悔棋與退出之類的一些功能,它們通過VC中強(qiáng)大的文檔編譯功能進(jìn)行自動生成,然后通過手工增加代碼和一些圖片,聲音等文件來進(jìn)行實現(xiàn)。

代碼片段和文件信息
//?AboutDlg.cpp?:?implementation?file
//
#include?“stdafx.h“
#include?“AboutDlg.h“
#include?“Globalvar.h“
#include?“HelperAPI.h“
#define?LENGTHES?170
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CAboutDlg?dialog
CAboutDlg::CAboutDlg(CWnd*?pParent?/*=NULL*/)
:?CDialog(CAboutDlg::IDD?pParent)
{
//{{AFX_DATA_INIT(CAboutDlg)
//?NOTE:?the?ClassWizard?will?add?member?initialization?here
//}}AFX_DATA_INIT
m_DyShow=0;
}
void?CAboutDlg::DoDataExchange(CDataExchange*?pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
DDX_Control(pDX?IDC_DYSTATIC?m_DyStatic);
DDX_Control(pDX?IDOK?m_OK);
DDX_Control(pDX?IDC_ADDRESS?m_Address);
DDX_Control(pDX?IDC_MORE?m_More);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg?CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
ON_BN_CLICKED(IDC_MORE?OnMore)
ON_WM_PAINT()
ON_WM_CLOSE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CAboutDlg?message?handlers
BOOL?CAboutDlg::OnInitDialog()?
{
CDialog::OnInitDialog();
HICON?hIcon?=?AfxGetApp()->LoadIcon(IDR_MAINframe);
SetIcon(hIcon?TRUE); //?Set?big?icon
SetIcon(hIcon?FALSE); //?Set?small?icon
CenterWindow();
m_Address.SetURL?(?_T(“mailto:shuker@263.net“)?);
m_Address.SetlinkCursor?(?AfxGetApp()->LoadCursor?(?IDC_HAND?)?);
m_Address.SetToolTip(?_T(“發(fā)郵件至:shuker@263.net“)?);
m_Address.SetUnderline();
m_Address.SetItalic();
m_OK.SetIcon?(?IDI_OPEN?);
m_OK.AddToolTip?(?_T(“確定“)?);
m_OK.SetBtnCursor(IDC_HAND);
m_OK.SetActiveFgColor(RGB(00255));
m_More.SetIcon?(?IDI_MORE?);
m_More.AddToolTip?(?_T(“更多的...“)?);
m_More.SetBtnCursor(IDC_HAND);
m_More.SetActiveFgColor(RGB(00255));
CString?str;
//?fill?memory?info
MEMORYSTATUS?MemStat;
MemStat.dwLength?=?sizeof(MEMORYSTATUS);
GlobalMemoryStatus(&MemStat);
//?Total?Physical?mem
str.Format(?_T(“%lu?KB“)?MemStat.dwTotalPhys?/?1024L);
SetDlgItemText(IDC_PHYSICAL_MEM?str);
//?Free?Physical?mem
str.Format(?_T(“%lu?KB“)?MemStat.dwAvailPhys?/?1024L);
SetDlgItemText(IDC_AVAIL_MEM?str);
//?Free?Virtual?mem
str.Format(?_T(“%lu?KB“)?MemStat.dwAvailVirtual?/?1024L);
SetDlgItemText(IDC_AVAIL_VIRTUAL_MEM?str);
//?fill?CPU?info
SYSTEM_INFO?SysInfo;
GetSystemInfo(&SysInfo);
switch?(SysInfo.dwProcessorType)
{
case?PROCESSOR_INTEL_486:
str?=?_T(“Intel?80486“);
break;
case?PROCESSOR_INTEL_PENTIUM:
str?=?_T(“Intel?Pentium“);
break;
default:
str?=?_T(““);
break;
}
SetDlgItemText(IDC_CPU?str);
//?fill?OS?info
OSVERSIONINFO?OsInfo;
OsInfo.dwOSVersionInfoSize?=?sizeof(OSVERSIONINFO);
if?(GetVersionEx(&OsInfo))
{
//?platform
switch?(OsInfo.dwPlatformId)
{
case?VER_PLATFORM_WIN32_WINDOWS:
str?=?_T(“Windows?95/98“);
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????6860??2001-01-28?13:55??代碼\BWChess\AboutDlg.cpp
?????文件???????1586??2001-01-28?13:23??代碼\BWChess\AboutDlg.h
?????文件???????2663??2001-01-28?14:02??代碼\BWChess\AddSec.cpp
?????文件???????1396??2001-01-28?14:02??代碼\BWChess\AddSec.h
?????文件???????4919??2001-01-28?14:10??代碼\BWChess\BestDlg.cpp
?????文件???????2187??2001-01-28?14:03??代碼\BWChess\BestDlg.h
?????文件??????16609??2001-01-28?14:11??代碼\BWChess\BtnST.cpp
?????文件???????5788??2001-01-28?14:11??代碼\BWChess\BtnST.h
?????文件?????301656??2008-06-24?18:15??代碼\BWChess\BWChess.aps
?????文件??????10728??2008-07-01?12:02??代碼\BWChess\BWChess.clw
?????文件???????1755??2001-05-05?11:02??代碼\BWChess\BWChess.cpp
?????文件??????12776??2001-04-13?21:02??代碼\BWChess\BWChess.dsp
?????文件????????539??2000-08-25?12:08??代碼\BWChess\BWChess.dsw
?????文件???????1474??2001-01-28?15:43??代碼\BWChess\BWChess.h
?????文件?????164864??2008-07-01?12:02??代碼\BWChess\BWChess.ncb
?????文件??????66048??2008-07-01?12:02??代碼\BWChess\BWChess.opt
?????文件???????1107??2008-07-01?12:02??代碼\BWChess\BWChess.plg
?????文件??????37159??2001-05-05?10:41??代碼\BWChess\BWChess.rc
?????文件?????121229??2001-05-05?11:06??代碼\BWChess\BWChessDlg.cpp
?????文件???????5097??2001-05-05?11:01??代碼\BWChess\BWChessDlg.h
?????文件???????2869??2001-01-28?15:42??代碼\BWChess\ConfirmSec.cpp
?????文件???????1425??2000-09-25?20:18??代碼\BWChess\ConfirmSec.h
?????文件??????28770??1998-01-13?11:41??代碼\BWChess\CREDITSTATIC.CPP
?????文件???????3580??1998-01-13?10:59??代碼\BWChess\CREDITSTATIC.H
?????文件??????31193??2008-07-01?12:02??代碼\BWChess\Debug\AboutDlg.obj
?????文件??????22160??2008-06-23?16:27??代碼\BWChess\Debug\AddSec.obj
?????文件??????39844??2008-06-23?16:27??代碼\BWChess\Debug\BestDlg.obj
?????文件??????52916??2008-06-23?16:27??代碼\BWChess\Debug\BtnST.obj
?????文件?????667702??2008-07-01?12:02??代碼\BWChess\Debug\BWChess.exe
?????文件?????720700??2008-07-01?12:02??代碼\BWChess\Debug\BWChess.ilk
............此處省略134個文件信息
評論
共有 條評論