package org.artisanlogiciel.games; import java.util.LinkedList; import java.util.Scanner; public class Main { public MazeParamEditor editor() { MazeParamEditor editor = new MazeParamEditor(null); System.out.println("enter width height and maxdepth"); Scanner console = new Scanner(System.in); editor.read(console); return editor; } public LabyMap generate2(MazeParamEditor params) { LabyModel model = new LabyModel(params, new java.util.Random(1024L)); model.generateWithEntry(0, 0); final int width = params.getWidth(); final int height = params.getHeight(); LinkedList exits = new LinkedList(); 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[]) { Main m = new Main(); MazeParamEditor editor = m.editor(); LabyMap map = m.generate2(editor); System.out.println(map.toShortString()); System.out.println(map.toString()); System.out.println(Brick.getDirLine()); } }