vc程序設(shè)計 英文[精校版本]_第1頁
vc程序設(shè)計 英文[精校版本]_第2頁
vc程序設(shè)計 英文[精校版本]_第3頁
vc程序設(shè)計 英文[精校版本]_第4頁
免費預(yù)覽已結(jié)束,剩余30頁可下載查看

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、VC+ PROJECTECJTUNAME STUDENT IDLIU * 2*LI * 2*DAI * 2*WANG * 2*ZUO * 2*STUDENT CLASS:CLASS 1MAJOR: 2*CertificateThis to certify that the following students:1. Liu *,and Student ID No is 2*2. Li * and Student ID No is 2*3. Dai * and Student ID No is 2*4. Wang * and Student ID No is 2*5. Zuo * and Stu

2、dent ID No is 2*are done this project under the guidance and supervision of MR.RAVI and it is submitted to the East China JiaoTong University as partial fulfillment of Software and Machanic & Electronics Engineering graduation.Signature of the GuideAcknowledgementFirstly, we would like to express my

3、 deep and sincere gratitude to our parents, as they gave me life and brought me up. Besides, they do their best to make our life better, but they seldom care about themselves. We know they have so many hopes and wishes for my future, and Ill do my best to respond you. Secondly, we warmly thank Profe

4、ssor Mr. Ravi for his valuable advice and patient help. He taught us the Visual C+ course and let me know the foundation of MFC. Moreover, thanks to the help of Mr. Ravi, my ability of spoken English has been improved.Finally, we would like express my thanks to other classmates who helped us with th

5、e process of doing the project.Content1. System study -5 2. Hardware and Software Required Developing the Project-73. Hardware and Software Required to Run Project-74. Screen shot- 85. Source Code-11 skyblue_LLK.h-11 skyblue_LLK.cpp-12 Resource.h-14 skyblue_LLKDlg.h-15 stdafx.h- 18 skyblue_LLKDlg.cp

6、p-19 StdAfx.cpp- 326. References- 321. System StudyA total of four lianliankan even method, but the algorithm only requires three.The first kind:Direct even. As long as the two pictures neighboring or two pictures a coordinate equal, are not equal coordinates between picture is empty.The second kind

7、: in one picture crossover square is alexandrine, find empty place in an array of record, let the array each worth with another picture position directly even calculation.Cross even.The third kind:The two pictures cross on the direction of empty place recorded in group 2 array, let two groups of arr

8、ay loop computations directly connected.Operation bought, there will be a table, there are disrupted sequence pairs of design.Click on one of the pattern, and then click another pattern, if accord with algorithm, it will be eliminated off.When all designs is eliminated, the game is over.C_LLK_Dlg: :

9、 StartNewGame () : initialization map, will map all squares regional position set to empty squares stateC_LLK_Dlg: : GameDraw (CDC * pDC) : game area of paintC_LLK_Dlg: : OnLButtonDown (nFlags, CPoint UINT point) : mouse the left key message handlingC_LLK_Dlg: : X1_Link_X2 (int x, int y1, int y2) :

10、x directly connectedC_LLK_Dlg: : Y1_Link_Y2 (int clamps its x1, int, int y x2) : y directly connectedC_LLK_Dlg: : LineX (int x, int y1, int y2) : whether a straight onC_LLK_Dlg: : LineY (int clamps its x1 int x2, int y, whether the line) : generalC_LLK_Dlg: : OneCornerLink (int clamps its x1 y1, int

11、 x2, int, int y2) : 1 right-angle interface connectivityC_LLK_Dlg: : TwoCornerLink (int clamps its x1 y1, int x2, int, int y2) : 2 right-angle interface connectivityC_LLK_Dlg: : IsLink (int clamps its x1 y1, int x2, int, int y2) : judge selected two squares whether can eliminateC_LLK_Dlg: : PreTrans

12、lateMessage (MSG * pMsg) : intercept keyboard messages F2 (for the new game)C_LLK_Dlg: : IsWin (use void) : to test whether has won the game2. Hardware and Software Required to Develop the ProjectHardware Processor: Intel(R) Core(TM)2 Duo CPU T5550 1.8GHzRam: 2GB RAMDisplay Adapter: WXGA LCD (1280*8

13、00)Monitor size : 14.1Keyboard: 104keysSoftwareMicrosoft Visual C+ Version: 6.0Operating system: Windows 7 Ultimate 7600 6.1.7600Database : Access versionProgramming Language:VC+IDE :Visual studio3.Hardware and Software Required to Run the Project HardwareProcessor: Intel(R) Pentium(TM)4 1.5GHzRam:

14、512MB RAMDisplay Adapter: 800*600 AboveKeyboard:104keysSoftware Microsoft Visual C+ Version: 6.0Operating system: Windows 2000/XP/Vista/7Database : Access versionProgramming Language: VC+IDE: Visual studio4.Screen shot Start the game Game playThe game ends5. Source Codeskyblue_LLK.h#if !defined(AFX_

15、SKYBLUE_LLK_H_A2AA2546_B9F0_4250_9623_03889A3B311A_INCLUDED_)#define AFX_SKYBLUE_LLK_H_A2AA2546_B9F0_4250_9623_03889A3B311A_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/

16、 CSkyblue_LLKApp:/ See skyblue_LLK.cpp for the implementation of this class/class CSkyblue_LLKApp : public CWinApppublic:CSkyblue_LLKApp();/ Overrides/ ClassWizard generated virtual function overrides/AFX_VIRTUAL(CSkyblue_LLKApp)public:virtual BOOL InitInstance();/AFX_VIRTUAL/ Implementation/AFX_MSG

17、(CSkyblue_LLKApp)/ NOTE - the ClassWizard will add and remove member functions here./ DO NOT EDIT what you see in these blocks of generated code !/AFX_MSGDECLARE_MESSAGE_MAP();/AFX_INSERT_LOCATION/ Microsoft Visual C+ will insert additional declarations immediately before the previous line.#endif /

18、!defined(AFX_SKYBLUE_LLK_H_A2AA2546_B9F0_4250_9623_03889A3B311A_INCLUDED_)skyblue_LLK.cpp/ skyblue_LLK.cpp : Defines the class behaviors for the application./#include stdafx.h#include skyblue_LLK.h#include skyblue_LLKDlg.h#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE = _FIL

19、E_;#endif/ CSkyblue_LLKAppBEGIN_MESSAGE_MAP(CSkyblue_LLKApp, CWinApp)/AFX_MSG_MAP(CSkyblue_LLKApp)/ NOTE - the ClassWizard will add and remove mapping macros here./ DO NOT EDIT what you see in these blocks of generated code!/AFX_MSGON_COMMAND(ID_HELP, CWinApp:OnHelp)END_MESSAGE_MAP()/ CSkyblue_LLKAp

20、p constructionCSkyblue_LLKApp:CSkyblue_LLKApp()/ TODO: add construction code here,/ Place all significant initialization in InitInstance/ The one and only CSkyblue_LLKApp objectCSkyblue_LLKApp theApp;/ CSkyblue_LLKApp initializationBOOL CSkyblue_LLKApp:InitInstance()AfxEnableControlContainer();/ Sta

21、ndard 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.C_LLK_Dlg dlg;m_pMainWnd = &dlg;int nResponse = dlg.DoModal();if (nResponse = IDOK)/ TODO: Place

22、 code here to handle when the dialog is/ dismissed with OKelse 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 applications message pump.return

23、 FALSE;Resource.h/NO_DEPENDENCIES/ Microsoft Developer Studio generated include file./ Used by skyblue_LLK.rc/#define IDD_SKYBLUE_LLK_DIALOG 102#define IDD_LLK_DIALOG 102#define IDR_MAINFRAME 128#define IDB_BMP_ANIMAL 130#define IDB_BITMAP_3D_FRAMES 131/ Next default values for new objects/ #ifdef A

24、PSTUDIO_INVOKED#ifndef APSTUDIO_READONLY_SYMBOLS#define _APS_NEXT_RESOURCE_VALUE 132#define _APS_NEXT_COMMAND_VALUE 32771#define _APS_NEXT_CONTROL_VALUE 1000#define _APS_NEXT_SYMED_VALUE 101#endif#endifskyblue_LLKDlg.h/*+Copyright (c) AFE(Active-Free-Elegance)Module Name: skyblue_LLKDlg.hAbstract:LL

25、K-Games kernal-solving DialogAuthor: Weijian Luo (Arthur Luo) 15-Jun-2005E-mail: skybluehackerRevision History: 1.0-*/#if !defined(AFX_SKYBLUE_LLKDLG_H_F043F328_5562_4EEC_921D_508E1DBDC900_INCLUDED_)#define AFX_SKYBLUE_LLKDLG_H_F043F328_5562_4EEC_921D_508E1DBDC900_INCLUDED_#if _MSC_VER 1000#pragma o

26、nce#endif / _MSC_VER 1000/ C_LLK_Dlg dialogclass C_LLK_Dlg : public CDialog/ Constructionpublic:/GameDrawvoid GameDraw(CDC * pDC);/StartNewGamevoid StartNewGame();BOOL IsLink(int x1,int y1,int x2,int y2);BOOL IsWin(void);/X=BOOL X1_Link_X2(int x,int y1,int y2);/Y=BOOL Y1_Link_Y2(int x1,int x2,int y)

27、;BOOL OneCornerLink(int x1,int y1,int x2,int y2);BOOL TwoCornerLink(int x1,int y1,int x2,int y2);BOOL YThrough(int x,int y,BOOL bAdd);BOOL XThrough(int x,int y,BOOL bAdd);BOOL LineX(int x,int y1,int y2);BOOL LineY(int x1,int x2,int y);C_LLK_Dlg(CWnd* pParent = NULL);/ standard constructorC_LLK_Dlg()

28、;/ Dialog Data/AFX_DATA(CTemp2Dlg)enum IDD = IDD_LLK_DIALOG ;/ NOTE: the ClassWizard will add data members here/AFX_DATA/ ClassWizard generated virtual function overrides/AFX_VIRTUAL(CTemp2Dlg)public:virtual BOOL PreTranslateMessage(MSG* pMsg);protected:virtual void DoDataExchange(CDataExchange* pDX

29、);/ DDX/DDV support/AFX_VIRTUAL/ Implementationprotected:HICON m_hIcon;CDCm_mem3DBkDC; CBitmap m_mem3DBkBmp; CDCm_memAnimalDC; CBitmap m_memAnimalBmp; CDCm_MemDC; CBitmap m_memBitmap; /地圖位置相關(guān)屬性組int*m_map; intm_nRow; intm_nCol; intm_nX1; intm_nY1; / Generated message map functions/AFX_MSG(CTemp2Dlg)v

30、irtual BOOL OnInitDialog();afx_msg void OnPaint();afx_msg HCURSOR OnQueryDragIcon();afx_msg void OnLButtonDown(UINT nFlags, CPoint point);/AFX_MSGDECLARE_MESSAGE_MAP();/AFX_INSERT_LOCATION/ Microsoft Visual C+ will insert additional declarations immediately before the previous line.#endif / !defined

31、(AFX_SKYBLUE_LLKDLG_H_F043F328_5562_4EEC_921D_508E1DBDC900_INCLUDED_)stdafx.h/ 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_F66DEF85_CF00_4F60_8D9D_B3BBB3169771_INCLUDED

32、_)#define AFX_STDAFX_H_F66DEF85_CF00_4F60_8D9D_B3BBB3169771_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 /

33、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_S

34、TDAFX_H_F66DEF85_CF00_4F60_8D9D_B3BBB3169771_INCLUDED_)skyblue_LLKDlg.cpp/*+Copyright (c) AFE(Active-Free-Elegance)Module Name: skyblue_LLKDlg.cppAbstract:LLK-Games kernal-solving DialogAuthor: Weijian Luo (Arthur Luo) 15-Jun-2005E-mail: skybluehackerRevision History: 1.0-*/#include stdafx.h#include

35、 skyblue_LLK.h#include skyblue_LLKDlg.h#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE = _FILE_;#endif/ C_LLK_Dlg dialog#define BKCOLOR RGB(128,128,128)#define FRONTWIDTH (39+2) #define FRONTHEIGHT (39+12) #define BKWIDTH 46#define BKHEIGHT 56#define ROWCOUNT 7#define COLCOUN

36、T 12#define BLANK_STATE -1 / C_LLK_Dlg dialogC_LLK_Dlg:C_LLK_Dlg(CWnd* pParent /*=NULL*/): CDialog(C_LLK_Dlg:IDD, pParent)/AFX_DATA_INIT(C_LLK_Dlg)/ NOTE: the ClassWizard will add member initialization here/AFX_DATA_INIT/ Note that LoadIcon does not require a subsequent DestroyIcon in Win32m_hIcon =

37、 AfxGetApp()-LoadIcon(IDR_MAINFRAME);m_nY1= BLANK_STATE;m_nX1= BLANK_STATE;m_nRow=ROWCOUNT;m_nCol=COLCOUNT;m_map=new intm_nRow*m_nCol;C_LLK_Dlg:C_LLK_Dlg()delete m_map;void C_LLK_Dlg:DoDataExchange(CDataExchange* pDX)CDialog:DoDataExchange(pDX);/AFX_DATA_MAP(C_LLK_Dlg)/ NOTE: the ClassWizard will ad

38、d DDX and DDV calls here/AFX_DATA_MAPBEGIN_MESSAGE_MAP(C_LLK_Dlg, CDialog)/AFX_MSG_MAP(C_LLK_Dlg)ON_WM_PAINT()ON_WM_QUERYDRAGICON()ON_WM_LBUTTONDOWN()/AFX_MSG_MAPEND_MESSAGE_MAP()/ C_LLK_Dlg message handlersBOOL C_LLK_Dlg:OnInitDialog()CDialog:OnInitDialog();/ Set the icon for this dialog. The frame

39、work does this automatically/ when the applications main window is not a dialogSetIcon(m_hIcon, TRUE);/ Set big iconSetIcon(m_hIcon, FALSE);/ Set small iconCDC *pWinDC = GetDC();m_mem3DBkDC.CreateCompatibleDC(pWinDC);m_mem3DBkBmp.LoadBitmap(IDB_BITMAP_3D_FRAMES);m_mem3DBkDC.SelectObject(&m_mem3DBkBm

40、p);m_memAnimalDC.CreateCompatibleDC(pWinDC);m_memAnimalBmp.LoadBitmap(IDB_BMP_ANIMAL);m_memAnimalDC.SelectObject(&m_memAnimalBmp);m_MemDC.CreateCompatibleDC(pWinDC);m_memBitmap.CreateCompatibleBitmap(pWinDC,m_nCol*FRONTWIDTH+5,m_nRow*FRONTHEIGHT+5);m_MemDC.SelectObject(&m_memBitmap);StartNewGame();H

41、WND hWnd = :AfxGetMainWnd()-m_hWnd;:SetWindowPos(hWnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);return TRUE; / return TRUE unless you set the focus to a controlvoid C_LLK_Dlg:StartNewGame()for(int iNum=0;iNum(m_nCol*m_nRow);iNum+)m_mapiNum = BLANK_STATE;srand(time(NULL);CDWordArray tmpMap;for(int

42、i=0;i(m_nCol*m_nRow)/4;i+)for(int j=0;j4;j+)tmpMap.Add(i);for(i=0;iFillSolidRect(0,0,m_nCol*FRONTWIDTH+5,m_nRow*FRONTHEIGHT+5,BKCOLOR);for(int i=0;im_nRow;i+)for(int j=0;jBitBlt(j*FRONTWIDTH,i*FRONTHEIGHT,BKWIDTH,BKHEIGHT,&m_mem3DBkDC,0,BKHEIGHT,SRCCOPY);pDC-BitBlt(j*FRONTWIDTH,i*FRONTHEIGHT,FRONTWIDTH-2,FRONTHEIGHT-12,&m_memAnimalDC,FRONTWIDTH-2,m_mapi*m_nCol+j*(FRONTHEIGHT-12),SRCAND);pDC-BitBlt(j*FRONTWIDTH,i*FRONTHEIGHT,FRONTWIDTH-2,FRONTHEIGHT-12,&m_memAnimalDC,0,m_mapi*m_nCol+j*(FRONTHEIGHT-12),SRCPAINT);/ The sys

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論