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
d94c44d3
Commit
d94c44d3
authored
Dec 19, 2020
by
Christian Wander
Browse files
clean up some comments
parent
7cae7a6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
blink.py
View file @
d94c44d3
...
...
@@ -8,6 +8,10 @@ class Thing:
def
console_print
(
self
):
"""Prints the pixel matrix in this object to the console.
The RGB values are just added together.
"""
for
line
in
self
.
matrix
:
for
item
in
line
:
print
(
"{0:3d}"
.
format
(
sum
(
item
)),
end
=
''
)
...
...
@@ -15,7 +19,7 @@ class Thing:
def
snake_tuple
(
self
):
"""Returns a tuple, where
where
the pixels in every 2nd line are in reverse order.
"""Returns a tuple, where the pixels in every 2nd line are in reverse order.
"""
...
...
@@ -23,9 +27,9 @@ class Thing:
def
snakify
(
self
):
"""Returns the snakified
s
tri
p
"""Returns the snakified
pixel ma
tri
x.
Expects a 2dim array of tuples!!1
The order of RGB values is reversed in every second line.
"""
result
=
[]
...
...
@@ -68,6 +72,7 @@ def from_heart(color = PINK):
"""
return
Thing
(
heart_tuple
(
color
))
def
from_eck
(
color
=
PINK
):
"""
Creates a Thing object that contains an eck
...
...
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