public static void main (final String[] args) {
        if (System.getProperty("display") == null) { // Default is graphics mode.
            System.setProperty("display", "graphics");
        }
        
        miner = getMiner(args);
        if (miner == null) {
            System.out.println("Please input correct Miner type.");
            return;
        }
        final ArrayList<String> mapList = getMap(args);
        if (mapList == null) {
            System.out.println("Please input correct Map file path.");
            return;
        }
        final Game game = new Game(mapList);

        final Gui gui = getGui(game);
        gui.display(game);
        audioPlayer = getAudioPlayer(game);

        while (game.getGameState() == Game.STATE_RUNNING) {
            final char next =
                    getNextAction(new Object[] { game.getCurX(),
                            game.getCurY(), game.getMap() });
            if (next == '\0') {
                System.out.println("Get action failed.");
                break;
            }

            game.play(next);
            gui.display(game);
            if (audioPlayer != null) {
                audioPlayer.play();
            }
        }
    }