Last active
March 27, 2019 15:42
-
-
Save LeonLenclos/30ff8f000c52472ef437f33ea48e9c10 to your computer and use it in GitHub Desktop.
Fill the terminal with shades of blue.
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
""" | |
Fill the terminal with shades of blue. | |
require the color module (`$ pip install color`). | |
""" | |
from random import choice | |
from shutil import get_terminal_size | |
from color import cyan, blue, magenta | |
def draw(f, size): | |
for _ in range(size): | |
print(f(), sep='', end='') | |
print() | |
def r(): | |
col = choice([blue, cyan, magenta]) | |
return col('▮') | |
height, width = get_terminal_size() | |
draw(r, height*width) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment