Skip to content

Instantly share code, notes, and snippets.

@pekochan069
Last active June 18, 2024 12:57
Show Gist options
  • Save pekochan069/365cdadf6851195e87317618d8e8ac8d to your computer and use it in GitHub Desktop.
Save pekochan069/365cdadf6851195e87317618d8e8ac8d to your computer and use it in GitHub Desktop.
qlock python bad implementation
from time import sleep
from datetime import datetime as d
def C(c,a):return a+c+"\x1b[0m"
a=open(__file__).read().replace(":\n",":").replace("\n",";").replace(" ","")
while 1:
c=d.now().strftime("%H:%M:%S")
for i in range(len(a)//64):
for j in range(64):
e=int((j/2)%4)
print(C(a[i*64+j],"\x1b[40;37;1m"if i>4 or e==3 or~[31599,19812,14479,31207,23524,29411,29679,30866,31727,31719,1040][10 if c[j//8]==":"else int(c[j//8])]>>(12-i*3+e)&1 else"\x1b[47;30;1m"), end="")
print()
print(C(a[64*(len(a)//64):],"\x1b[40;37;1m")+"\n\x1b[9A",end="\x1b[0J")
sleep(1)
@pekochan069
Copy link
Author

reduced from 11 lines to 9 lines of output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment