Created
February 22, 2012 02:12
-
-
Save aparrish/1880674 to your computer and use it in GitHub Desktop.
weird text blend procedure
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 sys | |
import random | |
lines = list() | |
for line in sys.stdin: | |
line = line.strip() | |
lines.append(line) | |
for i, line in enumerate(lines): | |
if len(line) == 0: | |
print "" | |
else: | |
char_list = list(line) | |
for pos in range(0, i, 2): | |
char_list[pos], char_list[pos+1] = char_list[pos+1], char_list[pos] | |
char_list[-(pos+1)], char_list[-(pos+2)] = char_list[-(pos+2)], char_list[-(pos+1)] | |
#print str(pos) + " " + str(i) + " " + ''.join(char_list) | |
print ''.join(char_list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment