minor changes (format + move class in stl package )

This commit is contained in:
philippe lhardy
2016-03-28 14:39:07 +02:00
parent 9333018aff
commit 8ac4b7693c
33 changed files with 2413304 additions and 1073 deletions

View File

@@ -6,50 +6,50 @@ import java.util.LinkedList;
public class Main
{
public WallsProvider generate(int width,int height, int maxdepth, MazeResolutionListener listener)
public WallsProvider generate(int width, int height, int maxdepth, MazeResolutionListener listener)
{
LabyModel model = new LabyModel(width, height,maxdepth, new java.util.Random());
model.generateWithEntry(0, 0);
LinkedList<Position> exits = new LinkedList<Position>();
model.addEntryOrExit(-1,0);
model.addEntryOrExit(width,height -1);
if ( ! model.check() )
{
System.out.println("Check failed");
}
model.resolve(width-1,height-1,listener);
return model;
LabyModel model = new LabyModel(width, height, maxdepth, new java.util.Random());
model.generateWithEntry(0, 0);
LinkedList<Position> exits = new LinkedList<Position>();
model.addEntryOrExit(-1, 0);
model.addEntryOrExit(width, height - 1);
if (!model.check())
{
System.out.println("Check failed");
}
model.resolve(width - 1, height - 1, listener);
return model;
}
public LabyMap generate2(int width,int height, int maxdepth)
public LabyMap generate2(int width, int height, int maxdepth)
{
LabyModel model = new LabyModel(width, height,maxdepth, new java.util.Random( 1024L));
model.generateWithEntry(0, 0);
LinkedList<Position> exits = new LinkedList<Position>();
model.addEntryOrExit(-1,0);
model.addEntryOrExit(width,height -1);
System.out.println(model.toLabyMap().toString());
if ( ! model.check() )
{
System.out.println("Check failed");
}
model.debugOut();
model.resolve(width-1,height-1,null);
LabyMap labyMap =model.toLabyMap();
return labyMap;
LabyModel model = new LabyModel(width, height, maxdepth, new java.util.Random(1024L));
model.generateWithEntry(0, 0);
LinkedList<Position> exits = new LinkedList<Position>();
model.addEntryOrExit(-1, 0);
model.addEntryOrExit(width, height - 1);
System.out.println(model.toLabyMap().toString());
if (!model.check())
{
System.out.println("Check failed");
}
model.debugOut();
model.resolve(width - 1, height - 1, null);
LabyMap labyMap = model.toLabyMap();
return labyMap;
}
public static void main(String pArgs[])
{
System.out.println("enter width height and maxdepth");
Scanner console = new Scanner(System.in);
int width = console.nextInt();
int height = console.nextInt();
int maxdepth = console.nextInt();
Main m= new Main();
LabyMap map = m.generate2(width,height,maxdepth);
System.out.println(map.toShortString());
System.out.println(map.toString());
System.out.println(Brick.getDirLine());
System.out.println("enter width height and maxdepth");
Scanner console = new Scanner(System.in);
int width = console.nextInt();
int height = console.nextInt();
int maxdepth = console.nextInt();
Main m = new Main();
LabyMap map = m.generate2(width, height, maxdepth);
System.out.println(map.toShortString());
System.out.println(map.toString());
System.out.println(Brick.getDirLine());
}
}