資源簡介
一個簡單的五子棋游戲 具有以下功能:①數據結構的設計;五子棋棋盤的繪制。②人機下棋時,計算機下棋算法的設計。③人機下棋時,判斷任一方獲勝的算法的設計。

代碼片段和文件信息
//?CEx_play.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“CEx_play.h“
#include?“MainFrm.h“
#include?“CEx_playDoc.h“
#include?“CEx_playView.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CEx_playApp
BEGIN_MESSAGE_MAP(CEx_playApp?CWinApp)
//{{AFX_MSG_MAP(CEx_playApp)
ON_COMMAND(ID_APP_ABOUT?OnAppAbout)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code!
//}}AFX_MSG_MAP
//?Standard?file?based?document?commands
ON_COMMAND(ID_FILE_NEW?CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN?CWinApp::OnFileOpen)
//?Standard?print?setup?command
ON_COMMAND(ID_FILE_PRINT_SETUP?CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CEx_playApp?construction
CEx_playApp::CEx_playApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CEx_playApp?object
CEx_playApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CEx_playApp?initialization
BOOL?CEx_playApp::InitInstance()
{
AfxEnableControlContainer();
//?Standard?initialization
//?If?you?are?not?using?these?features?and?wish?to?reduce?the?size
//??of?your?final?executable?you?should?remove?from?the?following
//??the?specific?initialization?routines?you?do?not?need.
#ifdef?_AFXDLL
Enable3dControls(); //?Call?this?when?using?MFC?in?a?shared?DLL
#else
Enable3dControlsStatic(); //?Call?this?when?linking?to?MFC?statically
#endif
//?Change?the?registry?key?under?which?our?settings?are?stored.
//?TODO:?You?should?modify?this?string?to?be?something?appropriate
//?such?as?the?name?of?your?company?or?organization.
SetRegistryKey(_T(“Local?AppWizard-Generated?Applications“));
LoadStdProfileSettings();??//?Load?standard?INI?file?options?(including?MRU)
//?Register?the?application‘s?document?templates.??Document?templates
//??serve?as?the?connection?between?documents?frame?windows?and?views.
CSingleDocTemplate*?pDocTemplate;
pDocTemplate?=?new?CSingleDocTemplate(
IDR_MAINframe
RUNTIME_CLASS(CEx_playDoc)
RUNTIME_CLASS(CMainframe)???????//?main?SDI?frame?window
RUNTIME_CLASS(CEx_playView));
AddDocTemplate(pDocTemplate);
//?Parse?command?line?for?standard?shell?commands?DDE?file?open
CCommandLineInfo?cmdInfo;
ParseCommandLine(cmdInfo);
//?Dispatch?commands?specified?on?the?command?line
if?(!ProcessShellCommand(cmdInfo))
return?FALSE;
//?The?one?and?only?window?has?been?initialized?so?show?and?update?it.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow()
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????41436??2010-12-29?14:48??五子棋\3_1.aps
?????文件??????51712??2010-12-29?17:57??五子棋\3_1.opt
?????文件??????41668??2010-12-29?18:11??五子棋\CEx_play.aps
?????文件???????1885??2010-12-29?18:13??五子棋\CEx_play.clw
?????文件???????4231??2010-12-29?18:17??五子棋\CEx_play.cpp
?????文件???????5143??2010-12-29?18:09??五子棋\CEx_play.dsp
?????文件????????541??2010-12-29?18:09??五子棋\CEx_play.dsw
?????文件???????1373??2010-12-29?18:19??五子棋\CEx_play.h
?????文件?????164864??2010-12-29?19:00??五子棋\CEx_play.ncb
?????文件??????51712??2010-12-29?19:00??五子棋\CEx_play.opt
?????文件????????910??2010-12-29?18:58??五子棋\CEx_play.plg
?????文件??????11328??2010-12-29?18:10??五子棋\CEx_play.rc
?????文件???????1765??2010-12-29?18:17??五子棋\CEx_playDoc.cpp
?????文件???????1490??2010-12-29?18:18??五子棋\CEx_playDoc.h
?????文件???????9607??2010-12-29?18:15??五子棋\CEx_playView.cpp
?????文件???????2140??2010-12-29?18:18??五子棋\CEx_playView.h
?????文件???????2694??2010-12-29?18:04??五子棋\MainFrm.cpp
?????文件???????1446??2001-11-15?18:08??五子棋\MainFrm.h
?????文件???????4373??2010-12-29?17:59??五子棋\ReadMe.txt
?????文件???????1011??2010-12-29?18:05??五子棋\resource.h
?????文件????????210??2010-12-29?18:00??五子棋\StdAfx.cpp
?????文件???????1054??2001-10-27?12:39??五子棋\StdAfx.h
?????文件???????1438??2001-11-15?18:17??五子棋\res\bitmap1.bmp
?????文件???????1438??2001-11-05?17:11??五子棋\res\bitmap2.bmp
?????文件???????3382??2001-11-05?17:14??五子棋\res\bmp00001.bmp
?????文件???????1334??2001-11-15?18:17??五子棋\res\bmp00002.bmp
?????文件???????1078??2001-10-27?12:39??五子棋\res\CEx_play.ico
?????文件????????399??2010-12-29?18:58??五子棋\res\CEx_play.rc2
?????文件???????1078??2001-10-27?12:39??五子棋\res\CEx_playDoc.ico
?????文件????????326??2001-10-27?20:02??五子棋\res\cursor1.cur
............此處省略9個文件信息
評論
共有 條評論