Skip to content

Commit

Permalink
Print chars instead of strings, this should take meta chars in consid…
Browse files Browse the repository at this point in the history
…eration as well
  • Loading branch information
jtwaleson committed Aug 8, 2012
1 parent 2665381 commit f949118
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions decrypt.py
Expand Up @@ -32,15 +32,18 @@ def iterate(increase = False):
first_line = 0
for line_num in range(first_line, final_line):
line = lines[line_num]
for i in [i for i in range(min(x, len(line))) if i not in confirmed_per_line[line_num]]:
still_random += 1
if random.random() < chance:
confirmed_per_line[line_num].append(i)
random_line = ''.join(random.choice(string.punctuation) if col not in confirmed_per_line[line_num] else line[col] for col in range(min(len(line), x)))
try:
screen.addstr(line_num - first_line, 0, random_line)
except Exception:
pass
for i in [i for i in range(min(x, len(line)))]:
if i not in confirmed_per_line[line_num]:
still_random += 1
if random.random() < chance:
confirmed_per_line[line_num].append(i)
char = random.choice(string.punctuation)
else:
char = line[i]
try:
screen.addch(line_num - first_line, i, char)
except Exception:
pass

screen.refresh()
time.sleep(0.1)
Expand Down

0 comments on commit f949118

Please sign in to comment.