Created
December 24, 2015 00:38
-
-
Save sundhaug92/9d2bef3f3de85ef51bfd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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