Skip to content

Instantly share code, notes, and snippets.

@ZengetsuFR
Created June 3, 2015 07:05
Show Gist options
  • Save ZengetsuFR/16fc5257923fddfb2745 to your computer and use it in GitHub Desktop.
Save ZengetsuFR/16fc5257923fddfb2745 to your computer and use it in GitHub Desktop.
Résolution du jeu "ASCII Art" sur le site codingame.com
import sys, math, re, string
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
L = int(raw_input())
H = int(raw_input())
T = raw_input()
T = T.upper() #on passe le texte en majuscule
alpha = string.ascii_uppercase + "?" #chaine de string avec toutes les lettres de l'alphabet + ?
for i in xrange(H):
ROW = raw_input()
lettre = ""
for char in T:
#on cherche la position de char dans la chaine alphabetique
index = alpha.find("?")*L if alpha.find(char)==-1 else alpha.find(char) * L
lettre = lettre + ROW[index:index+L]
print lettre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment