Skip to content
Permalink
Branch: master
Commits on Jul 15, 2019
  1. Fixed FarthestDeadEnd.__getIncreasingRadius: removed variable duplica…

    lukaszmn committed Jul 14, 2019
    …tion
    
    One thing was omitted during refactoring - the `distance` was passed as
    argument to the `__getIncreasingRadius()` method, and it was also
    calculated, overwriting that argument. The unnecessary calculation was
    removed here.
  2. Increased image size

    lukaszmn committed Jul 14, 2019
    The previous scale of drawing (plot) was good to have code and plot
    side-by-side in Spyder IDE. The size stopped being enough when I created
    an animation. It was small and the quality was poor. Here I doubled the size
    and increased the font's size.
  3. Fixed saving animation frames

    lukaszmn committed Jul 14, 2019
    As it turned out, after all refactorings the frame saving routine was
    not working. First of all, it was in incorrect class - now is in
    `MazeDrawer` as `saveFrame()` method. It required also access to current
    step, which was exposed in `get_step()` method of `StepController`
    class.
  4. Extracted MazeDrawer to a file

    lukaszmn committed Jun 24, 2019
    This step could have been done earlier, when creating the `MazeDrawer`
    class. It decreases the amount of lines of code in the main file, makes
    finding classes easier, and decreases imports in each file to only the
    ones that are necessary.
  5. generateMaze - included mazeDrawer

    lukaszmn committed Jun 24, 2019
    This is the final step to get rid of global `size_x` and `size_y`
    variables. The `MazeDrawer` object is now created inside
    `generateMaze`, not outside of it.
  6. MazeRules - added visitedMaze, visitedCell and visitCell

    lukaszmn committed Jun 24, 2019
    There were still some loose global variables and methods. Some could be
    very neatly included into `MazeRules` class. This also made a dependency
    onto that class for other: `CurrentCell` and `FarthestDeadEnd` now
    require a reference to `MazeRules` to get the path's length.
  7. MazeRules - added getPreviousCell

    lukaszmn committed Jun 24, 2019
    The logic of backtracking was moved into `getPreviousCell()` method of
    `MazeRules` class.
  8. Refactoring - Marking private members (2)

    lukaszmn committed Jun 24, 2019
    Continuing prefixing private members of classes with double underscore
    `__`. It also enforced adding some getters that would access the now-private members, like `get_x()`.
  9. Refactoring - Marking private members (1)

    lukaszmn committed Jun 24, 2019
    Continuing prefixing private members of classes with double underscore
    `__`.
  10. Refactoring - size_x, size_y as private fields

    lukaszmn committed Jun 24, 2019
    Some attempt was made to reduce the use of global `size_x` and `size_y`
    variables. And, by the way, private fields `size_x` and `size_y` were
    prefixed with double underscore `__`.
  11. Extracted MazeDrawer

    lukaszmn committed Jun 24, 2019
    Most code related to drawing was extracted to `MazeDrawer` class. By the
    way some routines were named to explain what they are doing, e.g.
    `drawBackgroundAndBorder()`. In order to limit graphic operations to one
    class, it was passed to the constructor of `CurrentCell`.
  12. CurrentCell - added getDecreasingRadius

    lukaszmn committed Jun 24, 2019
    Since `getDecreasingRadius()` method was used only by `CurrentCell`, it
    made sense to include it in that class.
  13. CurrentCell - added goBack

    lukaszmn committed Jun 24, 2019
    It's time now to extract the first `if` clause into the `goBack()` method of
    `CurrentCell` class.
  14. MazeRules - added Result

    lukaszmn committed Jun 24, 2019
    Instead of returning some magic numbers from `getNextCell()` method, an object
    `Result` is returned with all information being clear. The code is
    longer now, but that's a growth worth the clarity.
  15. Extracted MazeRules

    lukaszmn committed Jun 24, 2019
    The methods `getNextCell()`, `getValidDirections()` and `validCell()` consistuted for a new class `MazeRules`.
  16. CurrentCell - added moveForward

    lukaszmn committed Jun 24, 2019
    The `else` clause was extracted as `moveForward()` method of
    `CurrentCell`.
  17. Extracted CurrentCell

    lukaszmn committed Jun 24, 2019
    Now it's a little more complicated, as there were no methods that could
    be just copied. The newly created `CurrentCell` class should store
    location of the cell that's currently analyzed. It also stores the
    marker object used for drawing yellow circle.
  18. FarthestDeadEnd - included getIncreasingRadius

    lukaszmn committed Jun 24, 2019
    The `getIncreasingRadius()` method was included into the `FarthestDeadEnd`
    class, because it was used only by it.
  19. Extracted FarthestDeadEnd

    lukaszmn committed Jun 24, 2019
    The position of the farthest dead end and the entire `drawDeadEnd()`
    method were extracted to new class `FarthestDeadEnd`.
  20. Extracted StepController

    lukaszmn committed Jun 24, 2019
    Lines that were responsible for counting steps and checking step
    limit were extracted to a `StepController` class.
  21. Added visualization

    lukaszmn committed Jun 23, 2019
Commits on Jun 24, 2019
  1. First version

    lukaszmn committed Jun 24, 2019
You can’t perform that action at this time.