Fix indexerror from long text

This commit is contained in:
Tim Van Baak 2019-04-22 12:23:18 -07:00
parent 80685cd460
commit 144824b608
1 changed files with 1 additions and 1 deletions

2
horsay
View File

@ -26,7 +26,7 @@ horse_half = [
] ]
for i in range(max(len(horse_half), len(text_half))): for i in range(max(len(horse_half), len(text_half))):
if horse_half[i][-1] == '\u2500' and text_half[i][0] == '\u2502': if i < min(len(horse_half), len(text_half)) and horse_half[i][-1] == '\u2500' and text_half[i][0] == '\u2502':
text_half[i] = '\u2524' + text_half[i][1:] text_half[i] = '\u2524' + text_half[i][1:]
if i < len(horse_half): if i < len(horse_half):
sys.stdout.write(horse_half[i]) sys.stdout.write(horse_half[i])