diff options
-rw-r--r-- | oo.py | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -6,7 +6,20 @@ class ooPuzzle: No rendering information is stored or interpreted here. - All attributes are intended to be accessed through methods. + The following two attributes are to be accessed externally, + though editing them should be done through methods if possible: + + pieces is a dictionary mapping: + each position of form (x in range(self.X), + y in range(self.Y)) + to a piece id in range(6) + + orients is a dictionary mapping: + each position of form (x in range(self.X), + y in range(self.Y)) + to a direction index in range(4) + + All other attributes are intended to be accessed through methods. If direct access is necessary, here are their explanations: DIRECTIONS is a dictionary mapping: @@ -40,18 +53,6 @@ class ooPuzzle: toroidal is a bool indicating whether the border of the puzzle loops back to the opposite side NOT IMPLEMENTED! - - (the following are variable attributes during normal usage) - - pieces is a dictionary mapping: - each position of form (x in range(self.X), - y in range(self.Y)) - to a piece id in range(6) - - orients is a dictionary mapping: - each position of form (x in range(self.X), - y in range(self.Y)) - to a direction index in range(4) """ def __init__(self, X, Y, game_id=None, inverted=False, toroidal=False): """Create a new ooPuzzle instance. |