Last active
August 11, 2021 15:26
-
-
Save scturtle/926a3315f90fd7fd571a58411f688822 to your computer and use it in GitHub Desktop.
qlocktwo in python
This file contains 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
from datetime import datetime | |
t = datetime.now() | |
H, M = t.hour % 12, t.minute | |
HL, DK = '\033[0m', '\033[2m' | |
RESET = HL | |
MM = lambda *rgs: HL if any(a <= M < b for a, b in rgs) else DK | |
HH = lambda h: HL if (M < 35 and H == h) or (M >= 35 and H + 1 == h) else DK | |
print(f'''\ | |
{HL}I T{DK} L {HL}I S{DK} A S T I M E | |
{MM((15, 20), (45, 50))}A{DK} C {MM((15, 20), (45, 50))}Q U A R T E R{DK} D C | |
{MM((20, 30), (35, 45))}T W E N T Y {MM((5, 10), (25, 30), (35, 40), (55, 60))}F I V E{DK} X | |
{MM((30, 35))}H A L F{DK} B {MM((10, 15), (50, 55))}T E N{DK} F {MM((35, 60))}T O | |
{MM((5, 35))}P A S T{DK} E R U {HH(9)}N I N E | |
{HH(1)}O N E {HH(6)}S I X {HH(3)}T H R E E | |
{HH(4)}F O U R {HH(5)}F I V E {HH(2)}T W O | |
{HH(8)}E I G H T {HH(11)}E L E V E N | |
{HH(7)}S E V E N {HH(0)}T W E L V E | |
{HH(10)}T E N{DK} S E {MM((0, 5))}O C L O C K{RESET}''') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment