Commit 7cae7a6e authored by Christian Wander's avatar Christian Wander
Browse files

do some cleanup and add comments to factory methods

parent 5c2886f8
PINK = (255, 0, 255)
LIGHTBLUE = (0, 255, 255)
BLUE = (0, 0, 255)
class Thing:
def __init__(self, matrix):
......@@ -16,8 +18,8 @@ class Thing:
"""Returns a tuple, where where the pixels in every 2nd line are in reverse order.
"""
tmp = self.snakify()
return self.tuplify(tmp)
return self.tuplify(self.snakify())
def snakify(self):
......@@ -61,8 +63,17 @@ class Thing:
def from_heart(color = PINK):
"""
Creates an Thing object that contains a heart
"""
return Thing(heart_tuple(color))
def from_eck(color = PINK):
"""
Creates a Thing object that contains an eck
"""
return Thing(eck_tuple(color))
def heart_tuple(color):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment