honor run option with a default maze of 30x30
default_args in project Display.main() if argument is empty ignore it if file read fails, exit add a WHEREWHAT file extract MazeParamEditor to share it, prepare for having a GUI instead of console
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
package org.artisanlogiciel.games;
|
||||
|
||||
import java.util.Scanner;
|
||||
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 WallsProvider generate(int width, int height, int maxdepth, MazeResolutionListener listener)
|
||||
{
|
||||
@@ -41,13 +49,9 @@ public class Main
|
||||
|
||||
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);
|
||||
MazeParamEditor editor = m.editor();
|
||||
LabyMap map = m.generate2(editor.width, editor.height, editor.maxdepth);
|
||||
System.out.println(map.toShortString());
|
||||
System.out.println(map.toString());
|
||||
System.out.println(Brick.getDirLine());
|
||||
|
||||
Reference in New Issue
Block a user