Skip to content

Instantly share code, notes, and snippets.

@wkta
Last active August 29, 2015 13:57
Show Gist options
  • Save wkta/9537470 to your computer and use it in GitHub Desktop.
Save wkta/9537470 to your computer and use it in GitHub Desktop.
#MonthOfCode day 9 - jump
import os
import random
from time import sleep
def disp_word_letter_up( word, ind_letter=-1 ):
chars = list(word)
os.system('clear')# replace by os.system('cls') on windows systems
#upper row
for i in xrange( len(chars)):
if(ind_letter == i ):
print chars[i],
else:
print ' ',
print ;
print ;
#lower row
for i in xrange( len(chars)):
if(ind_letter == i ):
print ' ',
else:
print chars[i],
print ;
print 'type a word or a phrase, please'
da_input = raw_input()
disp_word_letter_up( da_input )
for i in xrange( len(da_input)-1,-1,-1 ):
sleep(0.5)
disp_word_letter_up( da_input , i)
sleep(0.5)
disp_word_letter_up( da_input )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment