-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathPython.py
33 lines (26 loc) · 983 Bytes
/
Python.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#****************************************#
#* *#
#* CodinGame.com Solutions by pathosDev *#
#* *#
#* Puzzle: ASCII Art *#
#* Difficulty: Easy *#
#* Date solved: 08.11.2018 *#
#* *#
#****************************************#
#Read inputs.
L = int(input())
H = int(input())
T = input().upper()
#Define index for non alphabetic chars.
unknownCharIndex = ord('Z') - ord('A') + 1
for i in range(H):
asciiLine = input()
for j in range(len(T)):
#Get ASCII index of current char.
charIndex = ord(T[j]) - ord('A')
letterIndex = charIndex if T[j].isalpha() else unknownCharIndex
#Get ASCII line of current char.
asciiPart = asciiLine[letterIndex * L : (letterIndex + 1) * L]
#Print ASCII line part.
print(asciiPart, end='')
print()