Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
we love ASCII ART
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
import java.util.*;
import java.io.*;
import java.math.*;
class Main {
public static void main(String args[]) {
//##################################################
String T = "WE LOVE ASCII ART"; // <--- Write your text here #
//##################################################
int longT = T.length();
int L = 4;
int H = 5;
String lettre[] = new String[longT];
int code[] = new int[longT];
String ligne[] = new String[H];
String dessinLettre[] = new String[H];
String dessinMot[] = new String[H];
ligne[0] = " # ## ## ## ### ### ## # # ### ## # # # # # ### # ## # ## ## ### # # # # # # # # # # ### ";
ligne[1] = "# # # # # # # # # # # # # # # # # ### # # # # # # # # # # # # # # # # # # # # # # # ";
ligne[2] = "### ## # # # ## ## # # ### # # ## # ### # # # # ## # # ## # # # # # # ### # # # ";
ligne[3] = "# # # # # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # # ### # # # # ";
ligne[4] = "# # ## ## ## ### # ## # # ### # # # ### # # # # # # # # # ## # ### # # # # # # ### ";
for (int i=0; i<longT; i++){
lettre[i] = Character.toString(T.charAt(i));
code[i] = T.charAt(i);
if (code[i] > 96 && code[i] < 123){code[i]=code[i]-32;}
if ((code[i] > 122 || code[i] < 96) && (code[i] < 65 || code[i] > 90)){code[i] = 63;}
}
int rang;
for (int comp=0; comp<H; comp++){dessinMot[comp]="";}
for (int r=0; r<longT;r++){
rang = (code[r]-65) * L;
if (rang<0){rang=26*4;}
for (int j=0; j < H ; j++ ) {
dessinLettre[j] = ligne[j].substring(rang,rang+L);
dessinMot[j] = dessinMot[j] + dessinLettre[j];
}
}
for (int j=0; j < H ; j++ ) {
System.out.println(dessinMot[j]);
}
Enter to Rename, Shift+Enter to Preview
you can change the message
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content