Reminder Programming Language: C++, C#, Python (Red font indicates the programming language used in this course)C Graphic Function Options: Win32 Program, MFC, WinForm, DirectX10 (bold indicates the program graphics category of this course, default is nongraphical interface)Win32 Console Program (Black Box, Text Interface) Win32 Console Program Data structure: basic type, array, linked list, bidirectional linked list, search tree (unbalanced binary tree), balanced binary tree, combination of linked list and balanced binary tree, stack, queue, string, graph (bold body indicates the data structure used in this lesson) C++ Language Items: STL Library STL Library Compiler environment: Windows 7 64-bit Flagship Edition ()Download Linux and other environments with caution Integrated development environment: Visual C++ 6.0, DEVC++, CodeBlocks, Visual Studio 2015 can be compiled.(The light blue font indicates that the modified version needs to be run, so the user can choose the source code test by himself.) Multi-header file compilation: No (all codes are basically contained in one file, if you need to test the function of header file, please refer to relevant literature by yourself) Content description: 1Topics and previews will be displayed on page 2. 2Number of lines of code:259 3The contents shown in the catalogue are basically covered in this article. If there is no content, it will be explained on this page. 4Appendix absolutely contains user's manual and complete source code and detailed annotations. 5If you need to download something else, this article will explain it here. Header files (for example, DirectX needs to be configured separately) 6In addition, due to my limited level, there are inevitably errors and omissions in the compilation. I urge teachers or students to criticize and correct them. On-line Report Name of program practice::_________________ Student name::_________________ Speciality::_________________ Class::_________________ Student ID::_________________ Guidance teacher::_________________ Boarding results::_________________ Location of boarding::_________________ Boarding time:_______________________ I. Purpose and Uploading(There Requirements of Engine can be multiple goals and requirements, corresponding to multiple on-line content) 1. Purpose of getting on the computer(For specific purposes, similar to asking questions) Applying theory to practice, we can grasp the knowledge of textbooks more fully, consolidate and deepen our understanding of textbook knowledge, and further improve our practical programming ability.Writing programs can not only exercise our practical ability, but also cultivate and improve our enthusiasm for learning.Snake Eating is a very simple and intelligent game, which is easy to write, and what we have learned can just solve this problem. First, we need to define the framework for writing snakes. Secondly, several classes are needed to control the operation of the whole game. Finally, how to solve the problem of snakes moving and eating food. 2. On-board Requirements(Specific boarding requirements and related problem analysis, similar to "analysis problems") Because the game is relatively simple, a class is enough to control the operation of the game. There is also the movement of the snake, because the snake eats a food, the corresponding length is increased by one, so it should be split into snake head, snake body, snake tail for more convenient operation. The snake head controls the direction of movement, and the snake head eats food, the snake tail does not need to be removed. II. Equipment (Environment) and Requirements Operating System: Windows 7 Compiler environment: VC6.0++. 3. Contents and Procedures of Uploading(Similar to "problem solving") 1, step 1 (1) On-line content (explicit on-line content): ideas and methods to solve problems (system/method/algorithm, etc.), combination of graphics and text Firstly, a two-dimensional array is defined to store the contents of the whole map. Secondly, a two-dimensional array is defined to record the movement direction of each part of the snake. Finally, the key to the whole game is analyzed. At first, we divided the snake into three parts: head, body and tail. As shown in the figure, the yellow one is the wall, which is the map of the initial state.                           food                     Snake tail Snake head                            

docxDoc C++ Course Design Snake Eating Game (with complete source code and accessories)

Professional Docs > Common > Other > Preview
26 Pages 0 Downloads 46 Views 3.0 Score
Tips: Current document can only be previewed at most page8,If the total number of pages in the document exceeds page 8,please download the document。
Uploaded by admin on 2019-10-15 12:08:09
Rate
You can enter 255 characters
What is my domain?( answer:www.45doc.com )
comments
  • No comments yet