Fix indexes confusion #20

Merged
regar42 merged 1 commits from fixIndexes into mvc 2017-12-19 21:35:22 +00:00
Owner

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

public Box (String label, int x , int y, Maze maze);

to

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.

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 antograb 2017-12-18 15:49:31 +00:00
regar42 closed this pull request 2017-12-19 21:35:22 +00:00
regar42 deleted branch fixIndexes 2017-12-19 21:35:32 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: antograb/TpMazeJava#20