Last active
August 29, 2015 13:57
-
-
Save wkta/9537470 to your computer and use it in GitHub Desktop.
#MonthOfCode day 9 - jump
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
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