Files
NotAlterra/_whale_preview.py
T

12 lines
354 B
Python

import time, sys
width = 40; direction = 1; pos = 0; whales = ['🐋', '🐳']; frame = 0
for _ in range(80):
bar = [' '] * width
bar[pos] = whales[frame % 2]
sys.stdout.write('\r[' + ''.join(bar) + ']')
sys.stdout.flush()
pos += direction; frame += 1
if pos <= 0 or pos >= width - 1: direction *= -1
time.sleep(0.05)
print()