Package aima.core.environment.eightpuzzle

Examples of aima.core.environment.eightpuzzle.EightPuzzleBoard.moveGapDown()


        board = new EightPuzzleBoard(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8});
        Random r = new Random(System.currentTimeMillis());
        for (int i = 0; i < 200 ; i++) {
          switch (r.nextInt(4)) {
          case 0: board.moveGapUp(); break;
          case 1: board.moveGapDown(); break;
          case 2: board.moveGapLeft(); break;
          case 3: board.moveGapRight(); break;
          }
        }
      }
View Full Code Here


      int th = r.nextInt(4);
      if (th == 0) {
        board.moveGapUp();
      }
      if (th == 1) {
        board.moveGapDown();
      }
      if (th == 2) {
        board.moveGapLeft();
      }
      if (th == 3) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.