Created
February 9, 2021 16:04
-
-
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!
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 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