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

📄 display.h

📁 一个在VISUAL C++下编程的soduku系统 里面有界面 有出盘 也比较简单
💻 H
字号:
/*
   Sudoku Quick and Easy Solver
   Copyright (C) 2005  Suhaib Chishtie

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License
   as published by the Free Software Foundation; either version 2
   of the License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/


#if !defined(AFX_DISPLAY_H__9FAEA69E_7C87_4C84_B533_75400D6D2585__INCLUDED_)
#define AFX_DISPLAY_H__9FAEA69E_7C87_4C84_B533_75400D6D2585__INCLUDED_


#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Display.h : header file
//
#include "resource.h"

DWORD __stdcall MEditStreamInCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb);
/////////////////////////////////////////////////////////////////////////////
// CDisplay dialog

class CDisplay : public CDialog
{

// Construction
public:
	~CDisplay();
	unsigned int all[9][9], RedBits[9][9], BlueBits[9][9];
	CDisplay(CWnd* pParent = NULL);   // standard constructor
	CRichEditCtrl *pCell[9][9], *pMsg;
	HANDLE hButtonEvent, hThread;
	CString msgstr, tmpstr;
	COLORREF	cellDefaultColor, cellHighColor;
	unsigned QuickSolve;
	CDuration dur_time;
	unsigned *solutions[1000], total_guesses, NoOfSol, StopGuess;


	unsigned NoOfPoss(unsigned cell);
	void dump_cell(unsigned cell);
	unsigned eliminate_lonely();
	unsigned eliminate_lonely_row();
	unsigned eliminate_lonely_col();
	unsigned eliminate_lonely_3x3();
	int remove_dup(unsigned no);
	unsigned check_row(unsigned row, unsigned cell, unsigned setBlue=0);
	unsigned check_col(unsigned col, unsigned cell, unsigned setBlue=0);
	unsigned check_3x3(unsigned row, unsigned col,unsigned cell, unsigned setBlue=0);
	unsigned eliminate_row_dup(unsigned row, unsigned cell);
	unsigned eliminate_col_dup(unsigned col, unsigned cell);
	unsigned eliminate_3x3_dup(unsigned row, unsigned col, unsigned cell);
	unsigned eliminate_lonely_cross();
	unsigned eliminate_lonely_row_cross();
	unsigned eliminate_lonely_col_cross();
	unsigned eliminate_lonely_3x3_cross();
	unsigned total_poss();
	signed solve();
	unsigned dump_all();
	void SetRowColor(unsigned i);
	void SetColColor(unsigned i);
	void Set3x3Color(unsigned row, unsigned col);
	void WaitForButton();
	void SetMsg();
	void ErrorMsg(CString msg);
	unsigned DoQuickSolve();
	void CDisplay::setRTF(CRichEditCtrl *pCell, CString text);
	// Dialog Data
	//{{AFX_DATA(CDisplay)
	enum { IDD = IDD_DIALOG1 };
	CStatic	m_Time;
	CComboBox	m_ComboBox;
	//}}AFX_DATA


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

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CDisplay)
	virtual BOOL OnInitDialog();
	afx_msg void OnButtonStep();
	afx_msg void OnButtonFinish();
	afx_msg void OnQuicksolve();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_DISPLAY_H__9FAEA69E_7C87_4C84_B533_75400D6D2585__INCLUDED_)

⌨️ 快捷键说明

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