People's things are either hungry or they're stuffed.
In fact, it is just two days before the children's Day, this is intended as a child's day gift to everyone, the results of the new account to 3 days to send articles to the homepage, so dragged to the present ... This is how it started: one day, the egg pain, see colleagues in the play minesweeper, and then think of their own to do a, so spent three days to write a mine ... After writing the minesweeper feel not enjoyable, and then wrote The Tetris, Flash is three days ... After writing the Tetris, feel charm, another, and then choose Sudoku, actually know this should be the most difficult, and indeed also tangled three days Sudoku generation algorithm just barely finished ... Okay, nonsense, don't say much.
1. Minesweeper: The only difficulty in this game is the recursive search in the empty space, do not spit groove color for what is green, because the green does not hurt the glasses o (╯-╰) o ... Originally was intended to be a WPF practice, but also feel that WPF is too troublesome, is not very familiar with the use of the wrong, so directly to WinForm, the green block is a label control, because the need to handle the mouse click operation, so more convenient point ...
2. Tetris: Does not involve what algorithm, recursive what complex thing, just the rules of rotation there are many kinds of, here is chosen to find in the online Tetris Master game rotation rules. All color blocks are drawn by GDI + because there is no need to handle interactions, so it is easier to draw
3. Sudoku: According to the rules of the game to generate the initial disk a bit difficult, while doing the side of the test finally found a feasible generation rule, the basic can be generated in 1 seconds, but there may be a failure of the situation, so have to generate and then check, if not, and then regenerate, generally can avoid this problem ... Color blocks are also used with the label ... Again, please do not care about the confusion of color.
PS: Although it has been working for several years, but the actual code is not much, usually soy sauce, when the egg pain will go to see the book, assorted to see a lot (WPF, WCF, WF, ASP. NET MVC, Android, LabView, but never used, so there is no egg) ... These three games, is also a temporary rise, fortunately finally all adhere to do, also calculate finish, finished feeling no matter how simple things only to do will know the fun and the difficulty lies ... Just write this, this is the first article of the blog, the result is such a hasty thing, alas ... Finally spit The trough one sentence: Why does not support markdown grammar%>_<% ...
Late children's Day gift--mini-game three-piece set: Minesweeper, Tetris, Sudoku