Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Sokoban state space explorer.
- // Discussion: https://dxdy.ru/topic144781.html
- public class State_Space_Explorer_2 {
- private static final String fileName = "..\\Microcosmos.txt";
- // private static final String fileName = "..\\Original.txt";
- // private static final String fileName = "..\\Yoshio52.txt";
- private static final int mapIndex = 10;
- public static void main (String [] args) {
- String [] mapLines;
- MapLoader mapLoader = new MapLoader ();
- MapHandler mapHandler = new MapHandler ();
- StateProcessor processor = new StateProcessor (mapHandler);
- if (!mapLoader .openFile (fileName)) {
- return;
- }
- /*
- int k = 0;
- while (mapLoader .loadNext ()) {
- System .out .println ("Map index: " + k);
- MapLoader .displayLines (mapLoader .getMapLines ());
- System .out .println ();
- ++k;
- }
- //*/
- mapLoader .skip (mapIndex);
- mapLoader .loadNext ();
- mapLoader .closeFile ();
- if (!mapLoader .hasLines ()) {
- System .out .println ("No map.");
- return;
- }
- mapLines = mapLoader .getMapLines ();
- MapLoader .displayLines (mapLines);
- if (mapHandler .process (mapLines)) {
- System .out .println (mapHandler .getErrorMessage ());
- return;
- }
- //mapHandler .displayMaze ();
- mapHandler .displayMazeWithActiveCells ();
- System .out .println ();
- processor .displayMapStats ();
- System .out .println ();
- processor .run (false);
- processor .displaySetStats ();
- processor .run (true);
- processor .displaySetStats ();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement