diff --git a/MCU/MCU_REAL_FINAL/MCU_1.uvopt b/MCU/MCU_REAL_FINAL/MCU_1.uvopt
index b06f386..128b1bb 100644
--- a/MCU/MCU_REAL_FINAL/MCU_1.uvopt
+++ b/MCU/MCU_REAL_FINAL/MCU_1.uvopt
@@ -293,6 +293,18 @@
0
0
+
+ 1
+ 8
+ 1
+ 0
+ 0
+ 0
+ .\mine.c
+ mine.c
+ 0
+ 0
+
@@ -303,7 +315,7 @@
0
2
- 8
+ 9
5
0
0
@@ -315,7 +327,7 @@
2
- 9
+ 10
5
0
0
@@ -327,7 +339,7 @@
2
- 10
+ 11
5
0
0
@@ -339,7 +351,7 @@
2
- 11
+ 12
5
0
0
@@ -351,7 +363,7 @@
2
- 12
+ 13
5
0
0
@@ -363,7 +375,7 @@
2
- 13
+ 14
5
0
0
@@ -375,7 +387,7 @@
2
- 14
+ 15
5
0
0
@@ -387,7 +399,7 @@
2
- 15
+ 16
5
0
0
@@ -399,7 +411,7 @@
2
- 16
+ 17
5
0
0
@@ -409,6 +421,18 @@
0
0
+
+ 2
+ 18
+ 5
+ 0
+ 0
+ 0
+ .\mine.h
+ mine.h
+ 0
+ 0
+
diff --git a/MCU/MCU_REAL_FINAL/MCU_1.uvproj b/MCU/MCU_REAL_FINAL/MCU_1.uvproj
index 504d171..917df15 100644
--- a/MCU/MCU_REAL_FINAL/MCU_1.uvproj
+++ b/MCU/MCU_REAL_FINAL/MCU_1.uvproj
@@ -411,6 +411,11 @@
1
.\eeprom.c
+
+ mine.c
+ 1
+ .\mine.c
+
@@ -461,6 +466,11 @@
5
.\eeprom.h
+
+ mine.h
+ 5
+ .\mine.h
+
diff --git a/MCU/MCU_REAL_FINAL/button.h b/MCU/MCU_REAL_FINAL/button.h
index 6dfaf2f..c4012b0 100644
--- a/MCU/MCU_REAL_FINAL/button.h
+++ b/MCU/MCU_REAL_FINAL/button.h
@@ -3,5 +3,6 @@
enum OPR {left,right,confirm,idle};
enum GS {__idle,start,good,over};
+enum MGS {_idle,mstart,mgood,mover};
#endif
\ No newline at end of file
diff --git a/MCU/MCU_REAL_FINAL/menu.c b/MCU/MCU_REAL_FINAL/menu.c
index 6273e04..8ba2ccf 100644
--- a/MCU/MCU_REAL_FINAL/menu.c
+++ b/MCU/MCU_REAL_FINAL/menu.c
@@ -28,8 +28,9 @@ enum OPR opr = idle;
static unsigned int local[4] = {0};
unsigned int score;
unsigned int bestScore[10];
+unsigned int mBestScore[10];
extern enum GS blockGameStatus;
-
+extern enum GS mineGameStatus;
//主菜单
void m_mainmenu(struct _menu* this)
diff --git a/MCU/MCU_REAL_FINAL/mine.c b/MCU/MCU_REAL_FINAL/mine.c
new file mode 100644
index 0000000..36e4e70
--- /dev/null
+++ b/MCU/MCU_REAL_FINAL/mine.c
@@ -0,0 +1,50 @@
+#include
+#include "mine.h"
+#include "button.h"
+#include
+
+enum MGS mineGameStatus = _idle;
+extern unsigned int mBestScore[];
+char mbase[MAX_MX][MAX_MY] = {0}; //x*y //0为空 -1为有雷 整数为雷的个数
+extern unsigned int score;
+extern enum OPR opr;
+
+
+unsigned mIsIegal(int i, int j)
+{
+ if(i >= 0 && i < MAX_MX && j >= 0 && j < MAX_MY)
+ return 1;
+ return 0;
+}
+
+unsigned int findSum(int i, int j)
+{
+ int re = 0;
+ if(mbase[i][j] == -1)
+ return -1;
+ else
+ {
+ mIsIegal(i, j + 1) ? re += mbase[i][j + 1] : 0;
+ mIsIegal(i, j - 1) ? re += mbase[i][j - 1] : 0;
+ mIsIegal(i + 1, j) ? re += mbase[i + 1][j] : 0;
+ mIsIegal(i - 1, j) ? re += mbase[i - 1][j] : 0;
+ mIsIegal(i - 1, j + 1) ? re += mbase[i - 1][j + 1] : 0;
+ mIsIegal(i + 1, j + 1) ? re += mbase[i + 1][j + 1] : 0;
+ mIsIegal(i - 1, j - 1) ? re += mbase[i - 1][j - 1] : 0;
+ mIsIegal(i + 1, j - 1) ? re += mbase[i + 1][j - 1] : 0;
+ }
+ return re;
+}
+
+void genMine()
+{
+ int i, j;
+ score = 0;
+ srand((unsigned)TL0);
+ for(i = 0; i < MAX_MY; i++)
+ mbase[rand() % 10][i] = -1;
+ for(i = 0; i < MAX_MX; i++)
+ for(j = 0; j < MAX_MX; j++)
+ mbase[j][i] = findSum(j, i);
+ mineGameStatus = start;
+}
\ No newline at end of file
diff --git a/MCU/MCU_REAL_FINAL/mine.h b/MCU/MCU_REAL_FINAL/mine.h
new file mode 100644
index 0000000..3c5a4ff
--- /dev/null
+++ b/MCU/MCU_REAL_FINAL/mine.h
@@ -0,0 +1,2 @@
+#define MAX_MX 8
+#define MAX_MY 8
\ No newline at end of file