已阅读5页,还剩28页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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 Student 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 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 Professor 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 the 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.cpp-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: 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 array 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: : 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) : 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 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: : PreTranslateMessage (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*800)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: 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_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/ 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(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 / !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 = _FILE_;#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_LLKApp 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();/ 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.C_LLK_Dlg dlg;m_pMainWnd = &dlg;int nResponse = dlg.DoModal();if (nResponse = IDOK)/ TODO: Place 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 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 APSTUDIO_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:LLK-Games kernal-solving DialogAuthor: Weijian Luo (Arthur Luo) 15-Jun-2005E-mail: Revision 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 once#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);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();/ 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);/ DDX/DDV support/AFX_VIRTUAL/ Implementationprotected:HICON m_hIcon;CDCm_mem3DBkDC; CBitmap m_mem3DBkBmp; CDCm_memAnimalDC; CBitmap m_memAnimalBmp; CDCm_MemDC; CBitmap m_memBitmap; /地图位置相关属性组int*m_map; intm_nRow; intm_nCol; intm_nX1; intm_nY1; / Generated message map functions/AFX_MSG(CTemp2Dlg)virtual 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(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_)#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 / 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_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: Revision History: 1.0-*/#include stdafx.h#include 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 COLCOUNT 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 = 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 add 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 framework 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_mem3DBkBmp);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();HWND 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 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 sy
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 常州时代数码广场商业项目运营策略
- 通州消防安全体验馆方案
- 滑雪场造雪设备运维安全指南(2025版)
- 双层钢筋笼整体防变形加固措施
- 电大病理学试题及答案
- 机修工考试试题及答案
- cnc编程试题及答案
- (完整版)围手术期预防性应用抗菌药物管理规定
- 高三地理土壤高频考点一轮复习教案
- 高中化学 高二下学期 选择性必修3 3.3.1 醛 酮 教学设计
- TD-T 1048-2016耕作层土壤剥离利用技术规范
- DL-T 5609-2021火力发电厂烟气海水脱硫系统设计规程-PDF解密
- 板蓝根片对精神疾病的预防和治疗作用
- 《弱国无外交》课件
- 2023年全国“动物疫病防治员”技能及理论知识考试题库(附含答案)
- 内蒙古2023年中学生生物学竞赛初赛试卷
- 中班语言-大树和小鸟
- 中国旅游文化-中国名山
- 安庆华兰科技有限公司 1000吨-年液体丁腈橡胶、30000吨-年羧基丁腈胶乳、10000吨-年高固丁苯胶乳建设项目环境影响报告书
- 霍尼韦尔VISTA系列报警主机调试指南
- 江苏易初新材料有限公司年产140吨氧化铪、7000吨氧化锆制备项目环境影响报告书
评论
0/150
提交评论