Created
October 13, 2023 05:08
-
-
Save heerdyes/df9f8ad26973da1c40bbb233395092fa to your computer and use it in GitHub Desktop.
digital clock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
# number chart | |
zero = [ | |
[' ', '_', '_', ' '], | |
['|', ' ', ' ', '|'], | |
['|', '_', '_', '|'], | |
[' ', ' ', ' ', ' '] | |
] | |
one = [ | |
[' ', ' ', ' ', ' '], | |
[' ', ' ', '|', ' '], | |
[' ', ' ', '|', ' '], | |
[' ', ' ', ' ', ' '] | |
] | |
two = [ | |
[' ', '_', '_', ' '], | |
[' ', '_', '_', '|'], | |
['|', '_', '_', ' '], | |
[' ', ' ', ' ', ' '] | |
] | |
# TODO: HW | |
three = [ | |
[' ', ' ', ' ', ' '], | |
[' ', ' ', '|', ' '], | |
[' ', ' ', '|', ' '], | |
[' ', ' ', ' ', ' '] | |
] | |
four = [ | |
[' ', '_', '_', ' '], | |
['|', ' ', ' ', '|'], | |
['|', '_', '_', '|'], | |
[' ', ' ', ' ', ' '] | |
] | |
five = [ | |
[' ', '_', '_', ' '], | |
['|', ' ', ' ', ' '], | |
[' ', '_', '_', ' '], | |
[' ', '_', '_', '|'] | |
] | |
six = [ | |
[' ', ' ', ' ', ' '], | |
[' ', ' ', '|', ' '], | |
[' ', ' ', '|', ' '], | |
[' ', ' ', ' ', ' '] | |
] | |
seven = [ | |
[' ', ' ', ' ', ' '], | |
[' ', ' ', '|', ' '], | |
[' ', ' ', '|', ' '], | |
[' ', ' ', ' ', ' '] | |
] | |
eight = [ | |
[' ', ' ', ' ', ' '], | |
[' ', ' ', '|', ' '], | |
[' ', ' ', '|', ' '], | |
[' ', ' ', ' ', ' '] | |
] | |
nine = [ | |
[' ', ' ', ' ', ' '], | |
[' ', ' ', '|', ' '], | |
[' ', ' ', '|', ' '], | |
[' ', ' ', ' ', ' '] | |
] | |
def matrixdisplay(m, n): | |
for i in m[0]: | |
print(i, end='') | |
for i in n[0]: | |
print(i, end='') | |
print() | |
for i in m[1]: | |
print(i, end='') | |
for i in n[1]: | |
print(i, end='') | |
print() | |
for i in m[2]: | |
print(i, end='') | |
for i in n[2]: | |
print(i, end='') | |
print() | |
for i in m[3]: | |
print(i, end='') | |
for i in n[3]: | |
print(i, end='') | |
print() | |
ng = [zero, one, two, three, four, five, six, seven, eight, nine] | |
for i in range(3): | |
for j in range(3): | |
matrixdisplay(ng[i], ng[j]) | |
print() | |
time.sleep(0.3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment