-
Notifications
You must be signed in to change notification settings - Fork 6
/
ArtAscii.txt
154 lines (133 loc) · 3.5 KB
/
ArtAscii.txt
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
// Read inputs from System.in, Write outputs to System.out.
// Your class name has to be Solution
import java.util.*;
import java.io.*;
import java.math.*;
class Solution {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int largeur = in.nextInt();
int hauteur = in.nextInt();
String line = in.nextLine();
line = in.nextLine();
//System.out.println(largeur);
//System.out.println(hauteur);
//System.out.println(line);
Character lettre[];
int nbLettre = line.length();
lettre = new Character[nbLettre];
for (int i = 0; i < nbLettre; i++) {
lettre[i] = line.charAt(i);
//System.out.println(lettre[i]);
}
String alphabet[][];
alphabet = new String[27][hauteur];
for(int i=0; i<hauteur ; i++){
line = in.nextLine();
while(line.length() < (27*largeur)){
line = line +" ";
}
for(int j = 0; j < 27 ; j++){
String lettreArt = line.substring(j*largeur,j*largeur+largeur);
alphabet[j][i] = lettreArt;
}
}
String mot[];
mot = new String[hauteur];
for(int j=0; j<hauteur; j++){
mot[j] = "";
}
for (int i = 0 ; i<nbLettre; i++){
for(int j=0; j<hauteur; j++){
mot[j] += codeAscii(alphabet,lettre[i],j);
}
}
for(int k = 0; k<hauteur;k++){
System.out.println( mot[k]);
}
}
public static String codeAscii(String alphabet[][], Character lettre, int h){
switch(lettre){
case 'a':
case 'A':
return alphabet[0][h];
case 'b':
case 'B':
return alphabet[1][h];
case 'c':
case 'C':
return alphabet[2][h];
case 'd':
case 'D':
return alphabet[3][h];
case 'E':
case 'e':
return alphabet[4][h];
case 'f':
case 'F':
return alphabet[5][h];
case 'g':
case 'G':
return alphabet[6][h];
case 'h':
case 'H':
return alphabet[7][h];
case 'i':
case 'I':
return alphabet[8][h];
case 'j':
case 'J':
return alphabet[9][h];
case 'k':
case 'K':
return alphabet[10][h];
case 'l':
case 'L':
return alphabet[11][h];
case 'm':
case 'M':
return alphabet[12][h];
case 'n':
case 'N':
return alphabet[13][h];
case 'o':
case 'O':
return alphabet[14][h];
case 'p':
case 'P':
return alphabet[15][h];
case 'q':
case 'Q':
return alphabet[16][h];
case 'r':
case 'R':
return alphabet[17][h];
case 's':
case 'S':
return alphabet[18][h];
case 't':
case 'T':
return alphabet[19][h];
case 'u':
case 'U':
return alphabet[20][h];
case 'v':
case 'V':
return alphabet[21][h];
case 'w':
case 'W':
return alphabet[22][h];
case 'x':
case 'X':
return alphabet[23][h];
case 'y':
case 'Y':
return alphabet[24][h];
case 'z':
case 'Z':
return alphabet[25][h];
default:
return alphabet[26][h];
}
}
}