Ejemplo n.º 1
0
  /**
   * The main program. ARGS may contain the options --seed=NUM, (random seed); --log (record moves
   * and random tiles selected.); --testing (take random tiles and moves from standard input); and
   * --no-display.
   */
  public static void main(String... args) {
    CommandArgs options = new CommandArgs("--seed=(\\d+) --log --testing --no-display", args);
    if (!options.ok()) {
      System.err.println(
          "Usage: java game2048.Main [ --seed=NUM ] " + "[ --log ] [ --testing ] [ --no-display ]");
      System.exit(1);
    }

    Main game = new Main(options);

    while (game.play()) {
      /* No action */
    }
    System.exit(0);
  }