I fixed the indexes confusion that was going on since the initFromTextFile(String filename) method in Maze.class. The goal of these changes is to represent the matrix containing the boxes the same way GUI coordinates are represented.
By that I mean, for each double for loop (when iterating the maze) :
line represents the line numbering, so the y coordinate in the GUI
row represents the row numbering, so the x coordinate in the GUI
I changed that for each for loop used to iterate the maze. Note that I also had to change
publicBox(Stringlabel,intx,inty,Mazemaze);
to
publicBox(Stringlabel,inty,intx,Mazemaze);
for the Box constructor. That is, of course, one way to do it. I could also have inverted compteurLigne and compteurColonne in initFromTextFile.
I fixed the indexes confusion that was going on since the `initFromTextFile(String filename)` method in `Maze.class`. The goal of these changes is to represent the matrix containing the boxes the same way GUI coordinates are represented.
By that I mean, for each double `for` loop (when iterating the maze) :
- `line` represents the line numbering, so the **y** coordinate in the GUI
- `row` represents the row numbering, so the **x** coordinate in the GUI
I changed that for each `for` loop used to iterate the maze. Note that I also had to change
```java
public Box (String label, int x , int y, Maze maze);
```
to
```java
public Box (String label, int y , int x, Maze maze);
```
for the Box constructor. That is, of course, one way to do it. I could also have inverted `compteurLigne` and `compteurColonne` in `initFromTextFile`.
regar42
was assigned by antograb2017-12-18 15:49:31 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I fixed the indexes confusion that was going on since the
initFromTextFile(String filename)method inMaze.class. The goal of these changes is to represent the matrix containing the boxes the same way GUI coordinates are represented.By that I mean, for each double
forloop (when iterating the maze) :linerepresents the line numbering, so the y coordinate in the GUIrowrepresents the row numbering, so the x coordinate in the GUII changed that for each
forloop used to iterate the maze. Note that I also had to changeto
for the Box constructor. That is, of course, one way to do it. I could also have inverted
compteurLigneandcompteurColonneininitFromTextFile.