WeChat mini programs have been very popular these days. They were officially released on the 9th. Today, 10 days have passed since the 19th, and there is a slight trend of cooling down. Major manufacturers have a very unfavorable attitude towards WeChat mini-programs. The most radical one is [Luoji Siwei], which directly removed its own [Get APP] from the shelves. Apps such as Didi and JD.com only retain the most streamlined functions. Some people worry that overly complete functions will rob users of the APP itself. However, this also confirms the original intention of the mini program, which is small, precise, and ready to go. (We do not deny the fact that Tencent’s WeChat platform is indeed rogue)
PS: Moji Weather has also developed a WeChat applet version and will release it as soon as possible on January 9th. Welcome to use it.
As a technician, how can you not try small program development yourself? Minesweeper
Implementation ideas:
- If you don’t know the rules of Minesweeper, please Google it yourself
- Draw a 10*10 map, mark mines and non-mines, and use numbers to indicate the number of mines around each point.
- Use mineMap[x][y] to represent a point
- mineMap[x][y] < 0 (== -1 in code) initial state
- 0 < mineMap[x][y] < 9 The number of mines around the point
- mineMap[x][y] == 9 means that the point is a mine
- mineMap[x][y] > 9 (== 10 in the code) indicates that a flag is placed at this point
Github
- https://github.com/jixiaod/wechat-app-minesweeper
How to run?
- Download & install WeChat applet development tools
- Just configure the wechat-app-minesweeper code directory to the development tool
How to play
- It should be noted that since there is no right mouse button to mark the Flag, you simply switch the Flag. After turning it on, you can mark the Flag.
- The original idea was to use tap and longtap to distinguish minesweeper and flag, but the development tools could not distinguish between these two events, so we had to give up.