WE LOVE ASCII ART

nbbroo
2,406 views
undefined

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content
Previous: try me

we love ASCII ART

import java.util.*;
import java.io.*;
import java.math.*;
class Main {
public static void main(String args[]) {
//###################################################
String T = "bacdcae"; // <--- Write your text here only abcde works #
//###################################################
int longT = T.length();
int L = 12;
int H = 4;
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]=" {}o o{} ' (> <) ' /(o o)/ (o o) (o p) ";
ligne[3]="oO--(-)--Oo oO--(-)--Oo oO--(-)--Oo oO--(_)--Oo oO--(d)--Oo ";
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]);
}
}}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Try your self

Open Source Your Knowledge: become a Contributor and help others learn. Create New Content