Skip to content

Instantly share code, notes, and snippets.

@Camilotk
Created January 2, 2022 05:47
Show Gist options
  • Save Camilotk/de9bbca48d8c300c3639b1fca5064f57 to your computer and use it in GitHub Desktop.
Save Camilotk/de9bbca48d8c300c3639b1fca5064f57 to your computer and use it in GitHub Desktop.
#! /usr/bin/python3
HEIGHT = 15
LENGTH = 30
CSI = '\x1b[38;5;'
n = 0
for i in range(HEIGHT):
is_first = i == 0
n = 1 if is_first else 2 * i
f = int((LENGTH-n)/2)
symbol = {
'star': '{}229m +'.format(CSI),
'leaf': '{}40m*'.format(CSI),
'deco': '{}9m@'.format(CSI)
}
for j in range(f):
print(' ', end='')
for j in range(n):
if is_first:
print('\033[73m' + symbol['star'], end='')
elif (j % 8) != 0:
print(symbol['leaf'], end='')
else:
print('\033[5m' + symbol['deco'] + '\033[0m', end='')
for j in range(f):
print(' ', end='')
print()
for i in range(int(HEIGHT/2)):
n = 4
f = int((LENGTH-n)/2)
for j in range(f):
print(' ', end='')
for j in range(n):
print('{}58m#'.format(CSI), end='')
for j in range(f):
print(' ', end='')
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment