Ejemplo n.º 1
0
  public static void main(String[] args) {
    Board b = new Board();
    b.printBoard();
    System.out.println();

    Hal me = new Hal(true, b);
    b = me.nextMove(b);
    b.printBoard();
    System.out.println();

    Hal them = new Hal(false, b);
    b = them.nextMove(b);
    b.printBoard();
    System.out.println();

    for (int i = 0; i < 20; i++) {
      me = new Hal(true, b);
      b = me.nextMove(b);
      b.printBoard();
      System.out.println();

      them = new Hal(false, b);
      b = them.nextMove(b);
      b.printBoard();
      System.out.println();
    }
  }
Ejemplo n.º 2
0
  public BobbyVsDerpy() {
    Board b = new Board();
    b.printBoard();
    System.out.println();
    DerpyBoard db = new DerpyBoard(b);
    db.printBoard();
    System.out.println();

    System.out.println("Derpy:");
    DerpyAI aiOne = new DerpyAI(true);
    db = aiOne.makeMove(db);
    b = db.boardEquiv();
    b.printBoard();
    System.out.println();

    v1Bobby bobby = new v1Bobby(b, false);
    System.out.println("Bobby:");
    b.setBoardArray(bobby.turn(b.getBoardArray()));
    b.printBoard();
    // long start;
    for (int i = 0; i < 100; i++) {
      // start = System.currentTimeMillis();
      System.out.println();
      System.out.println("Derpy:");
      db = new DerpyBoard(b);
      db = aiOne.makeMove(db);
      b = db.boardEquiv();
      b.printBoard();
      System.out.println();
      System.out.println("Bobby:");
      b.setBoardArray(bobby.turn(b.getBoardArray()));
      b.printBoard();

      // float time = System.currentTimeMillis() - start;
      // time = time / 1000F;
      // System.out.println(time);

    }
  }