資源簡介
從廣度優先搜索,深度優先搜索,A*算法多方面算法來解決八數碼問題
人工智能的作業
八數碼問題
用MFC做的,有界面 很好, 給大家共享下

代碼片段和文件信息
//?Chess.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“Chess.h“
#include?“MainFrm.h“
#include?“ChessDoc.h“
#include?“ChessView.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CChessApp
BEGIN_MESSAGE_MAP(CChessApp?CWinApp)
//{{AFX_MSG_MAP(CChessApp)
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()
/////////////////////////////////////////////////////////////////////////////
//?CChessApp?construction
CChessApp::CChessApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CChessApp?object
CChessApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CChessApp?initialization
BOOL?CChessApp::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(CChessDoc)
RUNTIME_CLASS(CMainframe)???????//?main?SDI?frame?window
RUNTIME_CLASS(CChessView));
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_SHOWMAXIMIZED);
m_pMainWnd->UpdateWindow();
return?TRUE;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2000-12-01?19:18??Chess\
?????文件???????48488??2000-12-06?03:42??Chess\Chess.aps
?????文件????????5172??2000-12-06?05:43??Chess\Chess.clw
?????文件????????4200??2001-12-01?06:11??Chess\Chess.cpp
?????文件????????4913??2000-12-02?22:56??Chess\Chess.dsp
?????文件?????????533??2001-12-01?06:12??Chess\Chess.dsw
?????文件????????1345??2001-12-01?06:11??Chess\Chess.h
?????文件??????123904??2000-12-06?05:43??Chess\Chess.ncb
?????文件???????60928??2000-12-06?05:43??Chess\Chess.opt
?????文件????????2234??2000-12-06?05:43??Chess\Chess.plg
?????文件???????17728??2000-12-06?03:42??Chess\Chess.rc
?????文件???????22100??2000-12-06?05:29??Chess\ChessDoc.cpp
?????文件????????2600??2000-12-06?04:41??Chess\ChessDoc.h
?????文件???????11456??2000-12-06?05:41??Chess\ChessView.cpp
?????文件????????2780??2000-12-05?02:32??Chess\ChessView.h
?????目錄???????????0??2000-12-06?03:47??Chess\Data\
?????文件????????1757??2000-12-05?05:14??Chess\DataType.cpp
?????文件????????1330??2000-12-05?02:20??Chess\DataType.h
?????文件??????????75??2000-12-06?04:19??Chess\Data\Data0.dat
?????文件??????????48??2000-12-06?03:48??Chess\Data\Data1.dat
?????文件??????????47??2000-12-06?04:12??Chess\Data\Data2.dat
?????文件??????????47??2000-12-06?04:15??Chess\Data\Data3.dat
?????文件??????????47??2000-12-06?04:14??Chess\Data\Data3.txt
?????文件??????????47??2000-12-06?04:17??Chess\Data\Data4.dat
?????文件???????19616??2000-12-06?05:42??Chess\EnterView.cpp
?????文件????????4357??2000-12-06?04:51??Chess\EnterView.h
?????文件????????1062??2000-12-01?22:17??Chess\Grid.cpp
?????文件????????1090??2000-12-01?20:29??Chess\Grid.h
?????文件????????3180??2000-12-01?20:26??Chess\MainFrm.cpp
?????文件????????1712??2001-12-01?08:33??Chess\MainFrm.h
?????文件????????4287??2001-12-01?06:11??Chess\ReadMe.txt
............此處省略9個文件信息
評論
共有 條評論