Skip to content

Instantly share code, notes, and snippets.

@EvansWinner
Created February 9, 2021 16:04
Show Gist options
  • Save EvansWinner/f578b0069546e5979b1ce47cf6d16f1d to your computer and use it in GitHub Desktop.
Save EvansWinner/f578b0069546e5979b1ce47cf6d16f1d to your computer and use it in GitHub Desktop.
Make a message float up the screen from random places in Python -- amuse children!
from time import sleep
from random import randint
import os
MESSAGE: str = "The helicoprion"
COLS: int
ROWS: int
COLS, ROWS = os.get_terminal_size()
SPARSENESS: int = 12
SPEED: float = 0.1 # Smaller is faster
if __name__ == "__main__":
for i in range(ROWS):
print() # Clear the screen
while True:
print(randint(1, COLS - len(MESSAGE) - 1) * " ", MESSAGE)
for i in range(randint(1, SPARSENESS)):
print()
sleep(SPEED)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment