// Because of its own level, write a small program to exercise, don't look at it.
Ok, say something simple but I think it is important.
People in this level (very vegetable dishes) seem to have a very sacred thing. Because it is generally in the company, it is allocated some modules, a few hundred lines, and the big tens of thousands of lines will basically do well.
I wrote a full 10,000 rows of things (of course, I can't even like myself, I don't like it.), In my opinion, I should still need something.
At least some of the idea of some program frame design is inside, there is no object-oriented design idea, and in the current level, the basic structure is difficult.
All right. We started to be involved in the topic.
It is the framework and design idea of the program, I have to combine the mine. (Sweeping? Yes, mine, WINDOW system comes with one of several small games, is it simple? I don't think).
Note: I don't know how the algorithm is in allocation of mines. So in www.google.com, I saw two people's mine clearance code, straightforward point, a written code, I only watched 30 seconds, I was from my hard disk Shift delete. .
The reason is that:
1 The structure is very confusing (this is critical), the program is not a good structure, indicating that your thoughts are chaotic.
2 No comments, the format is completely unregulated. Format, this is in my opinion, it can't be tolerated.
The other code is also, it is a cxxdlg.
In my current vision, the mine is small, but it can reflect the object-oriented thought.
Simple analysis, everyone looked laughed.
Three levels. (Project is a dialog-based Project)
CXXDLG object (dialog, managing mine array)
|
|
Cmesh object (land harness, managing a plaid)
|
|
CGRID object (a lattice, the most basic unit)
This is the specific embodiment of the mine and object-oriented ideas I have understood.
After distinguishing the object level, you will be easy to consider attributes and methods. Need practical, not saying.
Then you must determine a principle: who is processed, the answer is: Who will handle anyone.
The above is my processing principle (my practice prove, very effective).
For example, in a plaid area, click the left mouse button, how to deal with?
My handle: First, the CXXDLG object gets a message, passed to the CMESH object, and the CMESH object is transmitted to the CGRID object processing.
Ok, just so much.
LuWenguang_@hotmail.com (if you like)