VC做的贪吃蛇


基于MFC框架写的,里面有详细的注释,基本每个IT人员在学生时代都会写这些程序,所以我也写了,现在贴上了
资源截图
代码片段和文件信息
// GreedySnake.cpp : Defines the class behaviors for the application.
//

#include “stdafx.h“
#include “GreedySnake.h“

#include “MainFrm.h“
#include “GreedySnakeDoc.h“
#include “GreedySnakeView.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CGreedySnakeApp

BEGIN_MESSAGE_MAP(CGreedySnakeApp CWinApp)
//{{AFX_MSG_MAP(CGreedySnakeApp)
ON_COMMAND(ID_APP_ABOUT OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
//    DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CGreedySnakeApp construction

CGreedySnakeApp::CGreedySnakeApp()
{
// TODO: add construction code here
// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CGreedySnakeApp object

CGreedySnakeApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CGreedySnakeApp initialization

BOOL CGreedySnakeApp::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

// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T(“Local AppWizard-Generated Applications“));

LoadStdProfileSettings();  // Load standard INI file options (including MRU)

// Register the application‘s document templates.  Document templates
//  serve as the connection between documents frame windows and views.

CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINframe
RUNTIME_CLASS(CGreedySnakeDoc)
RUNTIME_CLASS(CMainframe)       // main SDI frame window
RUNTIME_CLASS(CGreedySnakeView));
AddDocTemplate(pDocTemplate);

// Parse command line for standard shell commands DDE file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);

// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;

// The one and only window has been initialized so show and update it.
m

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    1921024  2012-02-05 21:33  GreedySnake.exe

     文件    2056287  2012-02-05 21:36  GreedySnakeDebugGreedySnake.exe

     文件     331776  2012-02-05 21:36  GreedySnakeDebugGreedySnake.ilk

     文件      23493  2012-02-05 21:36  GreedySnakeDebugGreedySnake.obj

     文件    5502384  2012-02-05 21:36  GreedySnakeDebugGreedySnake.pch

     文件     353280  2012-02-05 21:36  GreedySnakeDebugGreedySnake.pdb

     文件    1607268  2012-02-05 21:36  GreedySnakeDebugGreedySnake.res

     文件      15234  2012-02-05 21:36  GreedySnakeDebugGreedySnakeDoc.obj

     文件      53547  2012-02-05 21:36  GreedySnakeDebugGreedySnakeView.obj

     文件      19379  2012-02-05 21:36  GreedySnakeDebugMainFrm.obj

     文件     105861  2012-02-05 21:36  GreedySnakeDebugStdAfx.obj

     文件     205824  2012-02-05 21:36  GreedySnakeDebugvc60.idb

     文件     364544  2012-02-05 21:36  GreedySnakeDebugvc60.pdb

     文件    1629604  2012-02-05 21:36  GreedySnakeGreedySnake.aps

     文件       2010  2012-02-05 21:37  GreedySnakeGreedySnake.clw

     文件       4299  2012-01-16 11:54  GreedySnakeGreedySnake.cpp

     文件       4904  2012-02-05 21:34  GreedySnakeGreedySnake.dsp

     文件        530  2012-01-16 11:54  GreedySnakeGreedySnake.dsw

     文件       1411  2012-01-16 11:54  GreedySnakeGreedySnake.h

     文件      91136  2012-02-05 21:37  GreedySnakeGreedySnake.ncb

     文件      49664  2012-02-05 21:37  GreedySnakeGreedySnake.opt

     文件       2162  2012-02-05 21:36  GreedySnakeGreedySnake.plg

     文件      11165  2012-02-05 20:53  GreedySnakeGreedySnake.rc

     文件       1842  2012-01-16 11:54  GreedySnakeGreedySnakeDoc.cpp

     文件       1530  2012-01-16 11:54  GreedySnakeGreedySnakeDoc.h

     文件      16037  2012-02-05 21:30  GreedySnakeGreedySnakeView.cpp

     文件       3274  2012-02-05 20:44  GreedySnakeGreedySnakeView.h

     文件       2606  2012-01-17 22:07  GreedySnakeMainFrm.cpp

     文件       1582  2012-01-17 12:23  GreedySnakeMainFrm.h

     文件       4431  2012-01-16 11:54  GreedySnakeReadMe.txt

............此处省略17个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)