Fix rectangle maze generation #3
+4
-7
@@ -90,7 +90,6 @@ public class Maze
|
|||||||
fr = new FileReader(filename) ;
|
fr = new FileReader(filename) ;
|
||||||
br = new BufferedReader(fr) ;
|
br = new BufferedReader(fr) ;
|
||||||
while (br.readLine() != null) dimensionY++;
|
while (br.readLine() != null) dimensionY++;
|
||||||
//System.out.println("Line count :" + lineCount);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
@@ -112,8 +111,6 @@ public class Maze
|
|||||||
|
|
||||||
while (currentLine != null)
|
while (currentLine != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
//System.out.println(currentLine);
|
|
||||||
currentLineLength = currentLine.length() ;
|
currentLineLength = currentLine.length() ;
|
||||||
|
|
||||||
for (int compteurColonne = 0 ; compteurColonne < currentLineLength ; compteurColonne++) {
|
for (int compteurColonne = 0 ; compteurColonne < currentLineLength ; compteurColonne++) {
|
||||||
@@ -122,16 +119,16 @@ public class Maze
|
|||||||
|
|
||||||
switch(currentChar) {
|
switch(currentChar) {
|
||||||
|
|
||||||
case 'W' : maze[compteurLigne][compteurColonne] = new WBox("W", compteurLigne, compteurColonne, this) ;
|
case 'W' : maze[compteurColonne][compteurLigne] = new WBox("W", compteurColonne, compteurLigne, this) ;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'E' : maze[compteurLigne][compteurColonne] = new EBox("E", compteurLigne, compteurColonne, this) ;
|
case 'E' : maze[compteurColonne][compteurLigne] = new EBox("E", compteurColonne, compteurLigne, this) ;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'D' : maze[compteurLigne][compteurColonne] = new DBox("D", compteurLigne, compteurColonne, this) ;
|
case 'D' : maze[compteurColonne][compteurLigne] = new DBox("D", compteurColonne, compteurLigne, this) ;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'A' : maze[compteurLigne][compteurColonne] = new ABox("A", compteurLigne, compteurColonne, this) ;
|
case 'A' : maze[compteurColonne][compteurLigne] = new ABox("A", compteurColonne, compteurLigne, this) ;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default : throw new MazeReadingException(filename) ;
|
default : throw new MazeReadingException(filename) ;
|
||||||
|
|||||||
Reference in new issue
Block a user