From: XinqiBao <35754562+XinqiBao@users.noreply.github.com> Date: Thu, 8 Mar 2018 03:43:39 +0000 (-0500) Subject: All done X-Git-Url: https://git.xinqibao.xyz/sudoku.git/commitdiff_plain/fb212e99cdd99bccff0e43eda7012f25d72a553a All done --- fb212e99cdd99bccff0e43eda7012f25d72a553a diff --git a/Debug/StdAfx.obj b/Debug/StdAfx.obj new file mode 100644 index 0000000..5fafc9a Binary files /dev/null and b/Debug/StdAfx.obj differ diff --git a/Debug/sudoku.exe b/Debug/sudoku.exe new file mode 100644 index 0000000..141c005 Binary files /dev/null and b/Debug/sudoku.exe differ diff --git a/Debug/sudoku.ilk b/Debug/sudoku.ilk new file mode 100644 index 0000000..485de39 Binary files /dev/null and b/Debug/sudoku.ilk differ diff --git a/Debug/sudoku.obj b/Debug/sudoku.obj new file mode 100644 index 0000000..7672ee7 Binary files /dev/null and b/Debug/sudoku.obj differ diff --git a/Debug/sudoku.pch b/Debug/sudoku.pch new file mode 100644 index 0000000..44af6fa Binary files /dev/null and b/Debug/sudoku.pch differ diff --git a/Debug/sudoku.pdb b/Debug/sudoku.pdb new file mode 100644 index 0000000..ba8f783 Binary files /dev/null and b/Debug/sudoku.pdb differ diff --git a/Debug/sudoku.res b/Debug/sudoku.res new file mode 100644 index 0000000..84e2ba7 Binary files /dev/null and b/Debug/sudoku.res differ diff --git a/Debug/sudokuDlg.obj b/Debug/sudokuDlg.obj new file mode 100644 index 0000000..b11b563 Binary files /dev/null and b/Debug/sudokuDlg.obj differ diff --git a/Debug/vc60.idb b/Debug/vc60.idb new file mode 100644 index 0000000..ba4e31f Binary files /dev/null and b/Debug/vc60.idb differ diff --git a/Debug/vc60.pdb b/Debug/vc60.pdb new file mode 100644 index 0000000..9562f84 Binary files /dev/null and b/Debug/vc60.pdb differ diff --git a/RCa04732 b/RCa04732 new file mode 100644 index 0000000..bc99b5c Binary files /dev/null and b/RCa04732 differ diff --git a/RCb04732 b/RCb04732 new file mode 100644 index 0000000..bc99b5c Binary files /dev/null and b/RCb04732 differ diff --git a/ReadMe.txt b/ReadMe.txt new file mode 100644 index 0000000..16927b2 --- /dev/null +++ b/ReadMe.txt @@ -0,0 +1,88 @@ +======================================================================== + MICROSOFT FOUNDATION CLASS LIBRARY : sudoku +======================================================================== + + +AppWizard has created this sudoku application for you. This application +not only demonstrates the basics of using the Microsoft Foundation classes +but is also a starting point for writing your application. + +This file contains a summary of what you will find in each of the files that +make up your sudoku application. + +sudoku.dsp + This file (the project file) contains information at the project level and + is used to build a single project or subproject. Other users can share the + project (.dsp) file, but they should export the makefiles locally. + +sudoku.h + This is the main header file for the application. It includes other + project specific headers (including Resource.h) and declares the + CSudokuApp application class. + +sudoku.cpp + This is the main application source file that contains the application + class CSudokuApp. + +sudoku.rc + This is a listing of all of the Microsoft Windows resources that the + program uses. It includes the icons, bitmaps, and cursors that are stored + in the RES subdirectory. This file can be directly edited in Microsoft + Visual C++. + +sudoku.clw + This file contains information used by ClassWizard to edit existing + classes or add new classes. ClassWizard also uses this file to store + information needed to create and edit message maps and dialog data + maps and to create prototype member functions. + +res\sudoku.ico + This is an icon file, which is used as the application's icon. This + icon is included by the main resource file sudoku.rc. + +res\sudoku.rc2 + This file contains resources that are not edited by Microsoft + Visual C++. You should place all resources not editable by + the resource editor in this file. + + + + +///////////////////////////////////////////////////////////////////////////// + +AppWizard creates one dialog class: + +sudokuDlg.h, sudokuDlg.cpp - the dialog + These files contain your CSudokuDlg class. This class defines + the behavior of your application's main dialog. The dialog's + template is in sudoku.rc, which can be edited in Microsoft + Visual C++. + + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named sudoku.pch and a precompiled types file named StdAfx.obj. + +Resource.h + This is the standard header file, which defines new resource IDs. + Microsoft Visual C++ reads and updates this file. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" to indicate parts of the source code you +should add to or customize. + +If your application uses MFC in a shared DLL, and your application is +in a language other than the operating system's current language, you +will need to copy the corresponding localized resources MFC42XXX.DLL +from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, +and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation. +For example, MFC42DEU.DLL contains resources translated to German.) If you +don't do this, some of the UI elements of your application will remain in the +language of the operating system. + +///////////////////////////////////////////////////////////////////////////// diff --git a/StdAfx.cpp b/StdAfx.cpp new file mode 100644 index 0000000..f23cb60 --- /dev/null +++ b/StdAfx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// sudoku.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + + + diff --git a/StdAfx.h b/StdAfx.h new file mode 100644 index 0000000..916b9cb --- /dev/null +++ b/StdAfx.h @@ -0,0 +1,27 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#if !defined(AFX_STDAFX_H__FCDE560B_D028_4F32_A27D_09437C0491DC__INCLUDED_) +#define AFX_STDAFX_H__FCDE560B_D028_4F32_A27D_09437C0491DC__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers + +#include // MFC core and standard components +#include // MFC extensions +#include // MFC Automation classes +#include // MFC support for Internet Explorer 4 Common Controls +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC support for Windows Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT + + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STDAFX_H__FCDE560B_D028_4F32_A27D_09437C0491DC__INCLUDED_) diff --git a/res/sudoku.ico b/res/sudoku.ico new file mode 100644 index 0000000..7eef0bc Binary files /dev/null and b/res/sudoku.ico differ diff --git a/res/sudoku.rc2 b/res/sudoku.rc2 new file mode 100644 index 0000000..9910e2f --- /dev/null +++ b/res/sudoku.rc2 @@ -0,0 +1,13 @@ +// +// SUDOKU.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED + #error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// diff --git "a/res/\346\225\260\347\213\2541.png" "b/res/\346\225\260\347\213\2541.png" new file mode 100644 index 0000000..539f690 Binary files /dev/null and "b/res/\346\225\260\347\213\2541.png" differ diff --git "a/res/\346\225\260\347\213\2541.txt" "b/res/\346\225\260\347\213\2541.txt" new file mode 100644 index 0000000..3dd6238 --- /dev/null +++ "b/res/\346\225\260\347\213\2541.txt" @@ -0,0 +1,81 @@ +0 +3 +0 +0 +0 +0 +0 +0 +0 +0 +5 +1 +8 +0 +0 +0 +6 +0 +0 +6 +0 +5 +7 +0 +3 +8 +9 +6 +0 +0 +2 +4 +0 +0 +0 +3 +0 +9 +0 +3 +0 +0 +0 +0 +1 +8 +0 +0 +9 +1 +0 +0 +0 +6 +1 +0 +0 +0 +8 +2 +0 +0 +5 +0 +7 +0 +0 +5 +0 +1 +0 +0 +5 +0 +6 +0 +0 +3 +7 +0 +2 \ No newline at end of file diff --git "a/res/\346\225\260\347\213\2542.png" "b/res/\346\225\260\347\213\2542.png" new file mode 100644 index 0000000..ee74b15 Binary files /dev/null and "b/res/\346\225\260\347\213\2542.png" differ diff --git "a/res/\346\225\260\347\213\2542.txt" "b/res/\346\225\260\347\213\2542.txt" new file mode 100644 index 0000000..f2e10cd --- /dev/null +++ "b/res/\346\225\260\347\213\2542.txt" @@ -0,0 +1,81 @@ +0 +0 +0 +0 +4 +0 +6 +8 +9 +0 +8 +0 +0 +6 +0 +0 +0 +0 +6 +4 +5 +2 +8 +9 +3 +7 +1 +4 +0 +3 +8 +1 +6 +5 +2 +7 +5 +1 +7 +9 +2 +3 +8 +6 +4 +8 +0 +6 +0 +0 +0 +9 +1 +0 +0 +0 +0 +0 +7 +0 +1 +9 +0 +7 +0 +1 +6 +9 +0 +0 +3 +0 +0 +6 +0 +1 +0 +4 +0 +0 +2 \ No newline at end of file diff --git "a/res/\346\225\260\347\213\2542\357\274\233.png" "b/res/\346\225\260\347\213\2542\357\274\233.png" new file mode 100644 index 0000000..a0ea174 Binary files /dev/null and "b/res/\346\225\260\347\213\2542\357\274\233.png" differ diff --git "a/res/\346\225\260\347\213\2542\357\274\233.txt" "b/res/\346\225\260\347\213\2542\357\274\233.txt" new file mode 100644 index 0000000..8cc7861 --- /dev/null +++ "b/res/\346\225\260\347\213\2542\357\274\233.txt" @@ -0,0 +1,81 @@ +1 +0 +2 +0 +4 +5 +6 +8 +9 +3 +8 +9 +7 +6 +1 +2 +4 +5 +6 +4 +5 +2 +8 +9 +3 +7 +1 +4 +9 +3 +8 +1 +6 +5 +2 +7 +5 +1 +7 +9 +2 +3 +8 +6 +4 +8 +2 +6 +4 +5 +7 +9 +1 +3 +2 +3 +4 +5 +7 +8 +1 +9 +6 +7 +5 +1 +6 +9 +2 +4 +3 +8 +9 +6 +8 +1 +3 +4 +7 +5 +2 \ No newline at end of file diff --git "a/res/\346\225\260\347\213\2543.png" "b/res/\346\225\260\347\213\2543.png" new file mode 100644 index 0000000..c3f871b Binary files /dev/null and "b/res/\346\225\260\347\213\2543.png" differ diff --git "a/res/\346\225\260\347\213\2543.txt" "b/res/\346\225\260\347\213\2543.txt" new file mode 100644 index 0000000..48e5b4e --- /dev/null +++ "b/res/\346\225\260\347\213\2543.txt" @@ -0,0 +1,81 @@ +8 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +3 +6 +0 +0 +0 +0 +0 +0 +7 +0 +0 +9 +0 +2 +0 +0 +0 +5 +0 +0 +0 +7 +0 +0 +0 +0 +0 +0 +0 +4 +5 +7 +0 +0 +0 +0 +0 +1 +0 +0 +0 +3 +0 +0 +0 +1 +0 +0 +0 +0 +6 +8 +0 +0 +8 +5 +0 +0 +0 +1 +0 +0 +9 +0 +0 +0 +0 +4 +0 +0 \ No newline at end of file diff --git a/resource.h b/resource.h new file mode 100644 index 0000000..b5846da --- /dev/null +++ b/resource.h @@ -0,0 +1,23 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by sudoku.rc +// +#define IDM_ABOUTBOX 0x0010 +#define IDD_ABOUTBOX 100 +#define IDS_ABOUTBOX 101 +#define IDD_SUDOKU_DIALOG 102 +#define IDR_MAINFRAME 128 +#define IDC_BUTTON1 1000 +#define IDC_BUTTON2 1001 +#define IDC_BUTTON3 1002 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1003 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/sudoku.aps b/sudoku.aps new file mode 100644 index 0000000..4979535 Binary files /dev/null and b/sudoku.aps differ diff --git a/sudoku.clw b/sudoku.clw new file mode 100644 index 0000000..531f267 --- /dev/null +++ b/sudoku.clw @@ -0,0 +1,57 @@ +; CLW file contains information for the MFC ClassWizard + +[General Info] +Version=1 +LastClass=CSudokuDlg +LastTemplate=CDialog +NewFileInclude1=#include "stdafx.h" +NewFileInclude2=#include "sudoku.h" + +ClassCount=3 +Class1=CSudokuApp +Class2=CSudokuDlg +Class3=CAboutDlg + +ResourceCount=3 +Resource1=IDD_ABOUTBOX +Resource2=IDR_MAINFRAME +Resource3=IDD_SUDOKU_DIALOG + +[CLS:CSudokuApp] +Type=0 +HeaderFile=sudoku.h +ImplementationFile=sudoku.cpp +Filter=N + +[CLS:CSudokuDlg] +Type=0 +HeaderFile=sudokuDlg.h +ImplementationFile=sudokuDlg.cpp +Filter=D +BaseClass=CDialog +VirtualFilter=dWC +LastObject=IDC_BUTTON2 + +[CLS:CAboutDlg] +Type=0 +HeaderFile=sudokuDlg.h +ImplementationFile=sudokuDlg.cpp +Filter=D + +[DLG:IDD_ABOUTBOX] +Type=1 +Class=CAboutDlg +ControlCount=4 +Control1=IDC_STATIC,static,1342177283 +Control2=IDC_STATIC,static,1342308480 +Control3=IDC_STATIC,static,1342308352 +Control4=IDOK,button,1342373889 + +[DLG:IDD_SUDOKU_DIALOG] +Type=1 +Class=CSudokuDlg +ControlCount=3 +Control1=IDC_BUTTON1,button,1342242816 +Control2=IDC_BUTTON2,button,1342242816 +Control3=IDC_BUTTON3,button,1342242816 + diff --git a/sudoku.cpp b/sudoku.cpp new file mode 100644 index 0000000..82c928b --- /dev/null +++ b/sudoku.cpp @@ -0,0 +1,74 @@ +// sudoku.cpp : Defines the class behaviors for the application. +// + +#include "stdafx.h" +#include "sudoku.h" +#include "sudokuDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CSudokuApp + +BEGIN_MESSAGE_MAP(CSudokuApp, CWinApp) + //{{AFX_MSG_MAP(CSudokuApp) + // NOTE - the ClassWizard will add and remove mapping macros here. + // DO NOT EDIT what you see in these blocks of generated code! + //}}AFX_MSG + ON_COMMAND(ID_HELP, CWinApp::OnHelp) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CSudokuApp construction + +CSudokuApp::CSudokuApp() +{ + // TODO: add construction code here, + // Place all significant initialization in InitInstance +} + +///////////////////////////////////////////////////////////////////////////// +// The one and only CSudokuApp object + +CSudokuApp theApp; + +///////////////////////////////////////////////////////////////////////////// +// CSudokuApp initialization + +BOOL CSudokuApp::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 + + CSudokuDlg dlg; + m_pMainWnd = &dlg; + int nResponse = dlg.DoModal(); + if (nResponse == IDOK) + { + // TODO: Place code here to handle when the dialog is + // dismissed with OK + } + else if (nResponse == IDCANCEL) + { + // TODO: Place code here to handle when the dialog is + // dismissed with Cancel + } + + // Since the dialog has been closed, return FALSE so that we exit the + // application, rather than start the application's message pump. + return FALSE; +} diff --git a/sudoku.dsp b/sudoku.dsp new file mode 100644 index 0000000..e83006d --- /dev/null +++ b/sudoku.dsp @@ -0,0 +1,146 @@ +# Microsoft Developer Studio Project File - Name="sudoku" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=sudoku - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "sudoku.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "sudoku.mak" CFG="sudoku - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "sudoku - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "sudoku - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "sudoku - Win32 Release" + +# PROP BASE Use_MFC 6 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 6 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x804 /d "NDEBUG" /d "_AFXDLL" +# ADD RSC /l 0x804 /d "NDEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 +# ADD LINK32 /nologo /subsystem:windows /machine:I386 + +!ELSEIF "$(CFG)" == "sudoku - Win32 Debug" + +# PROP BASE Use_MFC 6 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 6 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x804 /d "_DEBUG" /d "_AFXDLL" +# ADD RSC /l 0x804 /d "_DEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "sudoku - Win32 Release" +# Name "sudoku - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\StdAfx.cpp +# ADD CPP /Yc"stdafx.h" +# End Source File +# Begin Source File + +SOURCE=.\sudoku.cpp +# End Source File +# Begin Source File + +SOURCE=.\sudoku.rc +# End Source File +# Begin Source File + +SOURCE=.\sudokuDlg.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\Resource.h +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.h +# End Source File +# Begin Source File + +SOURCE=.\sudoku.h +# End Source File +# Begin Source File + +SOURCE=.\sudokuDlg.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\res\sudoku.ico +# End Source File +# Begin Source File + +SOURCE=.\res\sudoku.rc2 +# End Source File +# End Group +# Begin Source File + +SOURCE=.\ReadMe.txt +# End Source File +# End Target +# End Project diff --git a/sudoku.dsw b/sudoku.dsw new file mode 100644 index 0000000..5507f0e --- /dev/null +++ b/sudoku.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# ¾¯¸æ: ²»Äܱ༭»òɾ³ý¸Ã¹¤×÷ÇøÎļþ£¡ + +############################################################################### + +Project: "sudoku"=.\sudoku.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/sudoku.h b/sudoku.h new file mode 100644 index 0000000..9598eee --- /dev/null +++ b/sudoku.h @@ -0,0 +1,49 @@ +// sudoku.h : main header file for the SUDOKU application +// + +#if !defined(AFX_SUDOKU_H__0F260610_30CF_46EF_96D1_8A86E5F952CD__INCLUDED_) +#define AFX_SUDOKU_H__0F260610_30CF_46EF_96D1_8A86E5F952CD__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#ifndef __AFXWIN_H__ + #error include 'stdafx.h' before including this file for PCH +#endif + +#include "resource.h" // main symbols + +///////////////////////////////////////////////////////////////////////////// +// CSudokuApp: +// See sudoku.cpp for the implementation of this class +// + +class CSudokuApp : public CWinApp +{ +public: + CSudokuApp(); + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CSudokuApp) + public: + virtual BOOL InitInstance(); + //}}AFX_VIRTUAL + +// Implementation + + //{{AFX_MSG(CSudokuApp) + // NOTE - the ClassWizard will add and remove member functions here. + // DO NOT EDIT what you see in these blocks of generated code ! + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_SUDOKU_H__0F260610_30CF_46EF_96D1_8A86E5F952CD__INCLUDED_) diff --git a/sudoku.ncb b/sudoku.ncb new file mode 100644 index 0000000..aad397b Binary files /dev/null and b/sudoku.ncb differ diff --git a/sudoku.opt b/sudoku.opt new file mode 100644 index 0000000..376a50f Binary files /dev/null and b/sudoku.opt differ diff --git a/sudoku.plg b/sudoku.plg new file mode 100644 index 0000000..7c403fb --- /dev/null +++ b/sudoku.plg @@ -0,0 +1,16 @@ + + +
+

Build Log

+

+--------------------Configuration: sudoku - Win32 Debug-------------------- +

+

Command Lines

+ + + +

Results

+sudoku.exe - 0 error(s), 0 warning(s) +
+ + diff --git a/sudoku.rc b/sudoku.rc new file mode 100644 index 0000000..d8f92fa --- /dev/null +++ b/sudoku.rc @@ -0,0 +1,198 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Chinese (Öйú) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) +#ifdef _WIN32 +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +#pragma code_page(936) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)\r\n" + "#ifdef _WIN32\r\n" + "LANGUAGE 4, 2\r\n" + "#pragma code_page(936)\r\n" + "#endif //_WIN32\r\n" + "#include ""res\\sudoku.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#include ""l.chs\\afxres.rc"" // Standard components\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAINFRAME ICON DISCARDABLE "res\\sudoku.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "¹ØÓÚ sudoku" +FONT 9, "ËÎÌå" +BEGIN + ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 + LTEXT "sudoku 1.0 °æ",IDC_STATIC,40,10,119,8,SS_NOPREFIX + LTEXT "°æȨËùÓÐ (C) 2015",IDC_STATIC,40,25,119,8 + DEFPUSHBUTTON "È·¶¨",IDOK,178,7,50,14,WS_GROUP +END + +IDD_SUDOKU_DIALOG DIALOGEX 0, 0, 369, 265 +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU | WS_THICKFRAME +EXSTYLE WS_EX_APPWINDOW +CAPTION "Êý¶À" +FONT 9, "ËÎÌå" +BEGIN + PUSHBUTTON "ÌâÄ¿",IDC_BUTTON1,291,17,50,14 + PUSHBUTTON "Çó½â",IDC_BUTTON2,291,39,50,14 + PUSHBUTTON "ÏÂÒ»¸ö",IDC_BUTTON3,291,62,50,14 +END + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080404B0" + BEGIN + VALUE "CompanyName", "\0" + VALUE "FileDescription", "sudoku Microsoft »ù´¡ÀàÓ¦ÓóÌÐò\0" + VALUE "FileVersion", "1, 0, 0, 1\0" + VALUE "InternalName", "sudoku\0" + VALUE "LegalCopyright", "°æȨËùÓÐ (C) 2015\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "sudoku.EXE\0" + VALUE "ProductName", "sudoku Ó¦ÓóÌÐò\0" + VALUE "ProductVersion", "1, 0, 0, 1\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x804, 1200 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_ABOUTBOX, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 228 + TOPMARGIN, 7 + BOTTOMMARGIN, 48 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_ABOUTBOX "¹ØÓÚ sudoku(&A)..." +END + +#endif // Chinese (Öйú) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) +#ifdef _WIN32 +LANGUAGE 4, 2 +#pragma code_page(936) +#endif //_WIN32 +#include "res\sudoku.rc2" // non-Microsoft Visual C++ edited resources +#include "l.chs\afxres.rc" // Standard components +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/sudokuDlg.cpp b/sudokuDlg.cpp new file mode 100644 index 0000000..6d3fb10 --- /dev/null +++ b/sudokuDlg.cpp @@ -0,0 +1,365 @@ +// sudokuDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "sudoku.h" +#include "sudokuDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +int i_1,j_1; +int i=1,j=1,i_i,j_j; +int i_txt=0; +double a[10][10]; +double b[10][10]; +double c[10][10]; +int t,n,k=0; +int times=0; + +///////////////////////////////////////////////////////////////////////////// +// CAboutDlg dialog used for App About + +class CAboutDlg : public CDialog +{ +public: + CAboutDlg(); + +// Dialog Data + //{{AFX_DATA(CAboutDlg) + enum { IDD = IDD_ABOUTBOX }; + //}}AFX_DATA + + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CAboutDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + //{{AFX_MSG(CAboutDlg) + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) +{ + //{{AFX_DATA_INIT(CAboutDlg) + //}}AFX_DATA_INIT +} + +void CAboutDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CAboutDlg) + //}}AFX_DATA_MAP +} + +BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) + //{{AFX_MSG_MAP(CAboutDlg) + // No message handlers + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CSudokuDlg dialog + +CSudokuDlg::CSudokuDlg(CWnd* pParent /*=NULL*/) + : CDialog(CSudokuDlg::IDD, pParent) +{ + //{{AFX_DATA_INIT(CSudokuDlg) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT + // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); +} + +void CSudokuDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CSudokuDlg) + // NOTE: the ClassWizard will add DDX and DDV calls here + //}}AFX_DATA_MAP +} + +BEGIN_MESSAGE_MAP(CSudokuDlg, CDialog) + //{{AFX_MSG_MAP(CSudokuDlg) + ON_WM_SYSCOMMAND() + ON_WM_PAINT() + ON_WM_QUERYDRAGICON() + ON_BN_CLICKED(IDC_BUTTON1, OnButton1) + ON_BN_CLICKED(IDC_BUTTON2, OnButton2) + ON_BN_CLICKED(IDC_BUTTON3, OnButton3) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CSudokuDlg message handlers + +BOOL CSudokuDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // Add "About..." menu item to system menu. + + // IDM_ABOUTBOX must be in the system command range. + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); + + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != NULL) + { + CString strAboutMenu; + strAboutMenu.LoadString(IDS_ABOUTBOX); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + + // Set the icon for this dialog. The framework does this automatically + // when the application's main window is not a dialog + SetIcon(m_hIcon, TRUE); // Set big icon + SetIcon(m_hIcon, FALSE); // Set small icon + + // TODO: Add extra initialization here + + return TRUE; // return TRUE unless you set the focus to a control +} + +void CSudokuDlg::OnSysCommand(UINT nID, LPARAM lParam) +{ + if ((nID & 0xFFF0) == IDM_ABOUTBOX) + { + CAboutDlg dlgAbout; + dlgAbout.DoModal(); + } + else + { + CDialog::OnSysCommand(nID, lParam); + } +} + +// If you add a minimize button to your dialog, you will need the code below +// to draw the icon. For MFC applications using the document/view model, +// this is automatically done for you by the framework. + +void CSudokuDlg::OnPaint() +{ + if (IsIconic()) + { + CPaintDC dc(this); // device context for painting + + SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); + + // Center icon in client rectangle + int cxIcon = GetSystemMetrics(SM_CXICON); + int cyIcon = GetSystemMetrics(SM_CYICON); + CRect rect; + GetClientRect(&rect); + int x = (rect.Width() - cxIcon + 1) / 2; + int y = (rect.Height() - cyIcon + 1) / 2; + + // Draw the icon + dc.DrawIcon(x, y, m_hIcon); + } + else + { + CDialog::OnPaint(); + } + + + CClientDC dc(this); + + for(i_1=0;i_1<10;i_1++) + { + dc.MoveTo(20,20+40*i_1); + dc.LineTo(380,20+40*i_1); + if(i_1%3==0) + { + dc.MoveTo(20,20+40*i_1+1); + dc.LineTo(380,20+40*i_1+1); + } + } + for(j_1=0;j_1<10;j_1++) + { + dc.MoveTo(20+40*j_1,20); + dc.LineTo(20+40*j_1,380); + if(j_1%3==0) + { + dc.MoveTo(20+40*j_1+1,20); + dc.LineTo(20+40*j_1+1,380); + } + } + + if(i<1) + TextOut(dc,460,150,"ÎÞ½â",4); + else + { + CString cs; + for(i_1=1;i_1<10;i_1++) + { + for(j_1=1;j_1<10;j_1++) + { + if(a[i_1][j_1]!=0) + { + cs.Format("%.0f",a[i_1][j_1]); + TextOut(dc,40*j_1-10,40*i_1-10,cs,cs.GetLength()); + } + } + } + } + +} + +// The system calls this to obtain the cursor to display while the user drags +// the minimized window. +HCURSOR CSudokuDlg::OnQueryDragIcon() +{ + return (HCURSOR) m_hIcon; +} + +void CSudokuDlg::OnButton1() +{ + // TODO: Add your control notification handler code here + + CFileDialog fileDlg(TRUE); + fileDlg.m_ofn.lpstrTitle = "OpenFile"; + fileDlg.m_ofn.lpstrFilter = "Txt(*.txt)\0*.txt\0All Files(*.*)\0*.*\0\0"; + + CClientDC paDC(this); + CString strLine; + + i_txt=1; + if(IDOK == fileDlg.DoModal()) + { + CStdioFile file(fileDlg.GetFileName(),CFile::modeRead); + while(file.ReadString(strLine)) + { + //AfxMessageBox(strLine); + + float st=atof(strLine); + a[(i_txt-1)/9+1][(i_txt-1)%9+1]=st; + i_txt++; + if(i_txt==820) break; + } + + file.Close(); + Invalidate(); + } + + for(i_1=1;i_1<10;i_1++) + { + for(j_1=1;j_1<10;j_1++) + { + b[i_1][j_1]=a[i_1][j_1]; + } + } + for(i_1=1;i_1<10;i_1++) + { + for(j_1=1;j_1<10;j_1++) + { + c[i_1][j_1]=a[i_1][j_1]; + } + } + i=1;j=1;i_i=1;j_j=1; +} + +void CSudokuDlg::OnButton2() +{ + // TODO: Add your control notification handler code here + + if( times!=0 && c[i][j]==0 ) b[i][j]--; + times=0; + + i=i_i; + j=j_j; + for(i;i<10;i++) + { + // if(j==9) j=1; + for(j;j<10;j++) + { + if(c[i][j]==0) + { + for(t=b[i][j]+1;t<10;t++) + { + b[i][j]=t; + k=0; + for(n=0;n<9;n++) + { + if(k) break; + if( b[(i-1)/3*3+1+n/3][(j-1)/3*3+1+n%3]==b[i][j] && (i-1)/3*3+1+n/3!=i && (j-1)/3*3+1+n%3!=j ) + k=1; + } + for(n=1;n<10;n++) + { + if(k) break; + if( b[i][n]==b[i][j] && n!=j ) + k=1; + } + for(n=1;n<10;n++) + { + if(k) break; + if( b[n][j]==b[i][j] && n!=i ) + k=1; + } + if(!k) break; + } + if( b[i][j]==9 && k!=0 ) + { + b[i][j]=0; + + if(j==1) {i--;j=9;} + else j--; + + while(c[i][j]!=0) + { + if(j==1) {i--;j=9;} + else j--; + } + + if(j==1) {i--;j=9;} + else j--; + } + } + times++; + if(times==100000) + { + if( b[i][j]==9 && k!=0 ) + { + if(j==9) {i++;j=1;} + else j++; + } + break; + } + } + if(times==100000) break; + j=1; + } + i_i=i; + j_j=j; + + for(i_1=1;i_1<10;i_1++) + { + for(j_1=1;j_1<10;j_1++) + { + a[i_1][j_1]=b[i_1][j_1]; + } + } + + Invalidate(); + +} + +void CSudokuDlg::OnButton3() +{ + // TODO: Add your control notification handler code here + b[9][9]++; + i_i=9;j_j=9; + i=9;j=9; +} diff --git a/sudokuDlg.h b/sudokuDlg.h new file mode 100644 index 0000000..0bfeba1 --- /dev/null +++ b/sudokuDlg.h @@ -0,0 +1,52 @@ +// sudokuDlg.h : header file +// + +#if !defined(AFX_SUDOKUDLG_H__EE3D72D0_BFD8_4DB1_9290_B789D918D4EC__INCLUDED_) +#define AFX_SUDOKUDLG_H__EE3D72D0_BFD8_4DB1_9290_B789D918D4EC__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +///////////////////////////////////////////////////////////////////////////// +// CSudokuDlg dialog + +class CSudokuDlg : public CDialog +{ +// Construction +public: + CSudokuDlg(CWnd* pParent = NULL); // standard constructor + +// Dialog Data + //{{AFX_DATA(CSudokuDlg) + enum { IDD = IDD_SUDOKU_DIALOG }; + // NOTE: the ClassWizard will add data members here + //}}AFX_DATA + + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CSudokuDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + HICON m_hIcon; + + // Generated message map functions + //{{AFX_MSG(CSudokuDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + afx_msg void OnPaint(); + afx_msg HCURSOR OnQueryDragIcon(); + afx_msg void OnButton1(); + afx_msg void OnButton2(); + afx_msg void OnButton3(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_SUDOKUDLG_H__EE3D72D0_BFD8_4DB1_9290_B789D918D4EC__INCLUDED_)