jostbr / pymaze

A maze generator, solver and visualizer for Python
MIT License
272 stars 63 forks source link

De-Couple maze_viz and Maze class #17

Closed ThomasThelen closed 6 years ago

ThomasThelen commented 6 years ago

From the Maze __init__ signature, def __init__(self, num_rows, num_cols, cell_size): we can see that we're taking cell_size in.

Furthermore, we set three member variables to values derived from cell_size

self.cell_size = cell_size
self.height = num_rows*cell_size
self.width = num_cols*cell_size

I propose that we take these out of the Maze class because

  1. The information isn't used internally by the Maze, it's just accessed by maze_viz.
  2. Display properties of the Maze aren't really part of a maze. A maze can exist without the notion of cell_size
  3. Creates unnecessary coupling of information between objects
jostbr commented 6 years ago

With your newest pull request I think this issue is taken care of?