Add useless delays

This commit is contained in:
Midgard 2021-01-26 12:53:36 +01:00
parent bbe94a1124
commit 4582af4c43
Signed by: midgard
GPG Key ID: 511C112F1331BBB4
1 changed files with 12 additions and 3 deletions

15
hist.py
View File

@ -2,6 +2,7 @@
import sys
import re
import time
unknown = 0
skipped = 0
@ -20,6 +21,7 @@ for line in sys.stdin:
BLOCKS = "▁▂▃▄▅▆▇█"
HEIGHT = 20
SPEED = 400
max_val = max([*hours, unknown, skipped])
@ -39,6 +41,9 @@ def print_block(value, row):
else:
print(BLOCKS[int(height_value * len(BLOCKS))], end=" ")
sys.stdout.flush()
time.sleep(2 / SPEED)
cutoff = 12
hour_indices = [*range(cutoff, 24), *range(0, cutoff)]
@ -54,6 +59,10 @@ for row in range(HEIGHT):
print_block(unknown_norm, row)
print()
for h in hour_indices[::2]:
print(f"{h: >2}", end=" ")
print(" skp unk")
for c in (
"".join(f"{h: >2} " for h in hour_indices[::2]) +
" skp unk"
):
print(c, flush=True, end="")
time.sleep(1 / SPEED)
print()