⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eightnumsearchdlg.h

📁 一个8数码问题的解法
💻 H
字号:
// EightNumSearchDlg.h : header file
//

#if !defined(AFX_EIGHTNUMSEARCHDLG_H__398C54B9_6182_432C_8CED_C92C264578F4__INCLUDED_)
#define AFX_EIGHTNUMSEARCHDLG_H__398C54B9_6182_432C_8CED_C92C264578F4__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CEightNumSearchDlg dialog
const int SearchNum=1000;
typedef struct Node
{
	char matrix[3][3];//存储矩阵
	int d;//节点的深度
	int w;//目标节点比较错放的数字个数
	int f;//估价函数
	int x,y;//空格位置
}Node;

class CEightNumSearchDlg : public CDialog
{
// Construction
public:
	CEightNumSearchDlg(CWnd* pParent = NULL);	// standard constructor
	int n,m;//m标识最佳路径的节点,n标识生成的子节点
	int curstep;
	bool flat;//标识是否找到目标
// Dialog Data
	//{{AFX_DATA(CEightNumSearchDlg)
	enum { IDD = IDD_EIGHTNUMSEARCH_DIALOG };
	CButton	m_NextStep;
	CButton	m_ForthStep;
	CString	m_Com1Str1;
	CString	m_Com1Str2;
	CString	m_Com1Str3;
	CString	m_Com1Str4;
	CString	m_Com1Str5;
	CString	m_Com1Str6;
	CString	m_Com1Str7;
	CString	m_Com1Str8;
	CString	m_Com1Str9;
	CString	m_Com2Str1;
	CString	m_Com2Str2;
	CString	m_Com2Str3;
	CString	m_Com2Str4;
	CString	m_Com2Str5;
	CString	m_Com2Str6;
	CString	m_Com2Str7;
	CString	m_Com2Str8;
	CString	m_Com2Str9;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CEightNumSearchDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;
	char start[3][3];//存储初始节点
	char end[3][3];//存储目标节点
	Node base[SearchNum];
	void match(int n);
	void findkg(int n);
	void getf(int n);
	void paixu(int n,int m);
	void kong(int &m,int x,int y,int &n);
	int FileReadchar(CString FileName,char a[]);
	// Generated message map functions
	//{{AFX_MSG(CEightNumSearchDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnSolute();
	afx_msg void OnNextstep();
	afx_msg void OnForthstep();
	afx_msg void OnInputoral();
	afx_msg void OnInputobj();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_EIGHTNUMSEARCHDLG_H__398C54B9_6182_432C_8CED_C92C264578F4__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -