Skip to content

Instantly share code, notes, and snippets.

@sundhaug92
Created December 24, 2015 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sundhaug92/9d2bef3f3de85ef51bfd to your computer and use it in GitHub Desktop.
Save sundhaug92/9d2bef3f3de85ef51bfd to your computer and use it in GitHub Desktop.
import time
import sys
consolewidth=80
def delay_print(s):
for c in s:
sys.stdout.write( '%s' % c )
sys.stdout.flush()
time.sleep(float(1)/float(60))
def center_print(s):
if len(s)%2==0:
delay_print('#'+' '*(((consolewidth-2)-len(s))/2)+s+' '*(((consolewidth-2)-len(s))/2)+'#')
else:
delay_print('#'+' '*(((consolewidth-2)-len(s))/2)+s+' '*(((consolewidth-2)-len(s))/2+1)+'#')
sys.stdout.write("\x1b[2J\x1b[H")
delay_print('\r\n')
delay_print((' '*10)+'*'+' '*(consolewidth-10-2-10)+'\r\n')
for y in range(1,14):
if y<9:
if y%2==0:
delay_print((' '*(10-y))+'*'+(' '*(2*y-1))+'*')
else:
delay_print((' '*(10-y))+'/'+(' '*(2*y-1))+'\\')
elif y==9:
delay_print((' '*(10-y))+'/'+('-'*(2*y-1))+'\\')
if y<10:delay_print(' '*(10-y))
elif y<12:delay_print((' '*9)+'# #'+(' '*8))
elif y==12:delay_print((' '*9)+'####'+(' '*8))
if y==1:
delay_print('#'+'#'*(consolewidth-2)+'#')
elif y==2:
center_print('')
elif y==3:
center_print('God Jul')
elif y==4:
center_print('og')
elif y==5:
center_print(u'Godt nytt\u00e5r')
elif y==6:
center_print('')
elif y==7:
center_print('Fra')
elif y==8:
center_print('Martin')
elif y==9:
center_print('')
elif y==10:
delay_print('#'+'#'*(consolewidth-2)+'#')
delay_print('\r\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment