Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package AStar;
- import java.util.*;
- public class Main
- {
- public static void main(String[] args)
- {
- int userInput = 0;
- //Scanner kb = new Scanner(System.in);
- //3,1,2,6,4,5,0,7,8 312405678 625714083 250314687 235104678 d4 1,4,2,3,5,8,6,7,0 d6 1,4,2,3,0,7,6,8,5
- //D10 4,2,5,1,3,8,0,6,7 D12 1,4,2,6,7,5,8,3,0 D20 0,5,7,2,8,4,1,3,6 D 10 0,4,1,3,6,2,7,8,5 1,2,5,3,7,8,4,6,0
- //18,4,3,0,2,6,5,7 D20 0,8,5,2,3,7,1,4,6
- int[] test = {0,8,5,2,3,7,1,4,6}; //hi
- EightBoard board = new EightBoard(test, 1); //the entered heuristic will be overrided
- AStarAlg unfinished = new AStarAlg(board.getboardState());
- printResult(unfinished, board);
- //manhattans off and hashsets not working
- /*
- System.out.println("Iteration two");
- EightBoard board2 = new EightBoard(test, 2);
- AStarAlg unfinished2 = new AStarAlg(board2.getboardState());
- printResult(unfinished2, board2);
- */
- }
- public static void printResult(AStarAlg unfinished, EightBoard board)
- {
- boolean exploredSet = false;
- System.out.println("Manhattan nodes: " + unfinished.manhattan(exploredSet));
- System.out.println("Manhattan total steps: " + unfinished.getTotalSteps());
- System.out.println("Hamming nodes: " + unfinished.hamming(exploredSet));
- System.out.println("Hamming total steps: " + unfinished.getTotalSteps());
- System.out.println("\n\nExploredSet on Now");
- exploredSet = true;
- System.out.println("Manhattan Nodes: " + unfinished.manhattan(exploredSet));
- System.out.println("Manhattan total steps: " + unfinished.getTotalSteps());
- System.out.println("Hamming nodes: " + unfinished.hamming(exploredSet));
- System.out.println("Hamming total steps: " + unfinished.getTotalSteps());
- }
- public void menu()
- {
- Scanner kb = new Scanner(System.in);
- int userInput = 0;
- while(userInput != 1 && userInput != 2 && userInput != 3)
- {
- System.out.println("Welcome to my program.");
- System.out.println("Enter 1 to create your own puzzle.");
- System.out.println("Enter 2 to generate a random puzzle.");
- System.out.println("Enter 3 to exit.");
- System.out.print("Enter your choice here: ");
- userInput = kb.nextInt();
- }
- switch(userInput)
- {
- case 1:
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement