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

📄 aidlg.h

📁 八数码问题全局择优算法这个程序是上学期上人工智能课的时候
💻 H
字号:
// AIDlg.h : header file
//

#if !defined(AFX_AIDLG_H__995B2FBA_9E0D_483B_B252_03D1AD7D8538__INCLUDED_)
#define AFX_AIDLG_H__995B2FBA_9E0D_483B_B252_03D1AD7D8538__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CAIDlg dialog
struct picture
{
	CRect PicRect;//one rect for saving one small picture;
	int position;//record the small picture's positon;
};
struct status
{
	char position[9];//save the status for every small picture;
	char depth;
	char charge;
	struct status *Parent,*Next;//point to the next status;
};
class CAIDlg : public CDialog
{
// Construction
public:
	void Convert();
	void SetPicPosition();
	void Initial();
	CAIDlg(CWnd* pParent = NULL);	// standard constructor
	struct picture Pic[3][3];
	int Width;//record the whole picture's width;
	int Height;//record the whole picture's height;
	int InitialStatus[9];//record the start status;
	char ObjectStatus[9];//record the object status;
	int check[2][9];//the check[1][i] record the positon;
	struct status *head;
	struct status *autohead;
	int TimeCount;
	int MoveCount;
	BOOL MouseFlag;
	CBitmap Bmpic;
// Dialog Data
	//{{AFX_DATA(CAIDlg)
	enum { IDD = IDD_AI_DIALOG };
	CStatic	m_Time;
	CStatic	m_Count;
	CEdit	m_Edit9;
	CEdit	m_Edit8;
	CEdit	m_Edit7;
	CEdit	m_Edit6;
	CEdit	m_Edit5;
	CEdit	m_Edit4;
	CEdit	m_Edit3;
	CEdit	m_Edit2;
	CEdit	m_Edit1;
	//}}AFX_DATA

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

// Implementation
protected:
	BOOL CanMove(int position);
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CAIDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnBtnSet();
	afx_msg void OnBtnRead();
	afx_msg void OnAutocomplete();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnClose();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
public:
	BOOL Finished();
	void ReleaseSpace();
	void OnBtnSave();
	void OnBtnRefresh();
	void draw(int x,int y,int a,int b);
	void Prepare(struct status* object);
	void InSert(struct status* cNode,struct status* temp);
	BOOL NoSame(struct status* cNode);
	BOOL CanDown(struct status *cNode);
	BOOL CanUp(struct status *cNode);
	BOOL CanRight(struct status *cNode);
	BOOL CanLeft(struct status* cNode);
	BOOL Completed(struct status *cNode);
	int Charge(struct status*cNode);
	struct status* GlobalSelect();
	void OnMove(int& Position,int i,int j);
};

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

#endif // !defined(AFX_AIDLG_H__995B2FBA_9E0D_483B_B252_03D1AD7D8538__INCLUDED_)

⌨️ 快捷键说明

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