public static void main(String... args) {
        CommandArgs options =
                new CommandArgs("--white --ai=([012]) --seed=(\\d+) " +
                 "--time=([\\d\\.]+) --debug=(\\d+) --display", args);

        if (!options.ok()) {
            usage();
        }
        int debugLevel = options.getLast("--debug") == null ? 0 :
                 Integer.parseInt(options.getLast("--debug"));
        Reporter.setMessageLevel(debugLevel);
        Reporter.debug(2, "White: %b", options.containsKey("--white"));
        Reporter.debug(2, "AI Level: %s", options.getLast("--ai"));
        Reporter.debug(2, "Seed: %s", options.getLast("--seed"));
        Reporter.debug(2, "Time: %s", options.getLast("--time"));
        Reporter.debug(2, "Debug: %s", options.getLast("--debug"));
        Reporter.debug(2, "Display: %b", options.containsKey("--display"));

        int aiLevel = options.getLast("--ai") == null ? 1 :
                 Integer.parseInt(options.getLast("--ai"));
        long seed = options.getLast("--seed") == null ? 0 :
                 Long.parseLong(options.getLast("--seed"));
        int time = (int) (6 * 10 * (options.getLast("--time") == null ? -1 :
                 Double.parseDouble(options.getLast("--time"))));
        Side side = options.containsKey("--white") ? Side.WHITE : Side.BLACK;
        boolean display = options.containsKey("--display");
        Game simulation;
        if (display) {
            System.setOut(new PrintStream(new OutputStream() {

                @Override
                public void write(int b) throws IOException {
                }
            }));
            BoardGUI frame = new BoardGUI(Board.INITIAL_PIECES, side ==
                     Side.WHITE, time);
            simulation = new Game(2 - aiLevel, side, seed, time, frame);
            simulation.getBoard().setDisplay(frame);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.pack();
            frame.setResizable(false);
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
        } else {
            simulation = new Game(2 - aiLevel, side, seed, time, null);
        }
        simulation.play();


    }