@@ -0,0 +1,1121 @@
+import java.util.*;%0Aimport java.lang.*;%0Aimport java.io.*;%0A%0Apublic class mGrid %7B%0A%09int size;%0A%09int numMine;%0A%09%0A%09int rows;%0A%09int columns;%0A%09int Val;//the default int value is zero %0A%09int Player;%0A%09%0A%09mSingle%5B%5D%5B%5D mGrid_ = new mSingle%5B10%5D%5B10%5D;%0A%09%0A%09mGrid ()%7B%0A%09%09size = 10;%0A%09%09numMine = size;%0A%09%09rows = size;%0A%09%09columns = size;%0A%09%09%0A%09%09// random initialize the position of the mine%0A%09%09List%3CInteger%3E queue = new ArrayList%3C%3E();%0A%09%09for (int i = 1; i %3C= size*size; i++)%0A%09%09%7B%0A%09%09%09if (i%3C=10)queue.add(1);%0A%09%09%09else queue.add(0);%0A%09%09%7D%0A%09%09Collections.shuffle(queue);%0A        %0A%09%09// initialize the grid%0A        for(int i=0;i%3Crows;i++) %7B %0A        %09for(int j=0;j%3Ccolumns;j++) %7B%0A        %09%09if (queue.get(i*10+j+1)==1)%7B%0A        %09%09%09mGrid_%5Bi%5D%5Bj%5D = new mSingle(true); %0A        %09%09%7D %0A        %09    else%7B%0A        %09    %09mGrid_%5Bi%5D%5Bj%5D = new mSingle(false); %0A        %09    %7D%0A        %09%7D%0A        %7D%0A        %0A        // add adjacent button information%0A        for(int i=0;i%3Crows;i++) %7B %0A        %09for(int j=0;j%3Ccolumns;j++) %7B%0A        %09%09if (queue.get(i*10+j+1)==1)%7B%0A        %09%09%09// check the adjacent button and assign that information%0A        %09%09%7D%0A        %09    %7D%0A        %09%7D%0A        %7D%0A%7D%0A

Create mGrid.java