Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Chris
Pixelframe
Commits
7cae7a6e
Commit
7cae7a6e
authored
Dec 19, 2020
by
Christian Wander
Browse files
do some cleanup and add comments to factory methods
parent
5c2886f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
blink.py
View file @
7cae7a6e
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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment