c blog 06- structures

1. This chapter summarizes the study (2 points)
1.1 learning content summary
organize and file structure chapter two main points, must contain the contents are:

How to define the structure, how to assign a member of
an array of structures sorting practices
structure pointer how to use
a union, enumerated practice
file read and write, how to read the data file into the array of structures
1.2 Studying chapter
describes the learning experience, may be where you do not understand the proposed place of the teaching suggestions, and so on.
Calculate the amount of code for two weeks, whether the goal.
2. Integrated operations - "I love the idiom" (8 points)
The idiom job to write a game. After the user logs in, the system randomly out of a number of idioms, if the answer to score. User score file write performance. System users can rank the results
main functions:
landing. You need to enter the correct user name and password to login. Error error message.
Idiom game. Randomly idiom file from a phrase, a random show two characters, the remaining characters a user to guess. If the answer is scored. Error, to the appropriate information.
Rankings. With user score ranking system.
Exit
Requirements:
The job must realize construction of multi-file C. Wherein the structure is defined, the function definitions to be packaged in a custom header file. A module corresponds to .c file and a .h file. Data definition and data separation.
User login, data ranking information, please encapsulating structure is achieved.
3 relates to the data files: user.txt, ranking.txt, idiom.txt
minimize the use of global variables, data transfer by the address, passing parameters. Learn to use the function parameter, the function returns the value of independence.
User-friendly menu, any step can be launched at any time, the program will not crash. Program interface have a clear screen.
Try to write a function to debug a function, the function can read and write files to ensure data do the following content.
Data Description:
user.txt: user name, password
ranking.txt: user name, answer the total score, the final answer time. Note: Each time the answer score is accumulated scores, such as the correct answer 5 points, next time to play with the same user name, where data can be accumulated or updated.
idiom.txt: idiom, idioms explained. Note: The data also include numbers for everyone, it is recommended to lower data preprocessing, the data is transformed into canonical form. Idiom: Idiom interpretation. Others such as [] appears, so digital filter out. Unified data format to do reading and writing.
Extension
of this question could make a dictionary of idioms, idioms user input, you can check the appropriate idiom explanation. This query can be fuzzy query, the user input is just a character can also check the contents of all the relevant idioms.
Gameplay can be varied, for example, can do idiom, you write a phrase, according to the last Chinese character, idiom under a system capable of Solitaire. If you are playing man-machine interaction, not the solitaire rules may prompt
2.1. Document describes the
header file describes the
header file 1.h
introduce a header file which structure and function declarations, what is their function? List grid can be more clear and intuitive
header code shots
header files 2.h
introduce a header file which structure and function declarations, what their function is? List grid can be more clear and intuitive
header code shots
header files 3.h
describes header files which structure and function declarations have, what their function? Column table can be more clear and intuitive
header code theme
2. Introduction function implementation file.
File 1: main.c
presentation file function and design ideas.
Screenshot the main code
file 2: Login.c
Introduces the main function and the function code.
Screenshot the main code
file 3: idiom.c
introduces the main function and the function code.
Screenshot major code
and so on other files

2.2 operating results
1. login screen
2. The game interface
3. rankings interface
2.3 big job summary
1. encountered problems and solutions
can list shows.

2. Summary of
major operations code delivery

Guess you like

Origin www.cnblogs.com/weiershui/p/12046514.html