public void resetGame(int sx,int sy)//清空地圖、隨機地圖、重設按鈕文字
    {
        gameOver = false;
        aroundBombNum = new int[mapHeight][mapWidth];//清空地圖
        map = new boolean[mapHeight][mapWidth];
        isPressed = new boolean[mapHeight][mapWidth];
        isTurned = new boolean[mapHeight][mapWidth];
        
        int bombCount = 0;
        while(bombCount < bombNum)
        {
            int x = (int)(Math.random()*mapHeight);
            int y = (int)(Math.random()*mapWidth);
            if(sx!=x|sy!=y)
            if(!map[x][y])//沒炸彈
            {
                bombCount++;//放了炸彈
                map[x][y] = true;
                //向周圍宣布有炸彈 
                for(int i=x-1; i<=x+1; i++)
                    for(int j = y-1; j<=y+1; j++)
                    {
                        if(i>=0&&i<mapHeight&&j>=0&&j<mapWidth)
                            aroundBombNum[i][j]++;
                    }
            }
        }
            
        System.out.println("地圖建置成功");
        printMap();
    }