How can I prepare every single letter of a text as a specific sign?
in
Programming Questions
•
2 years ago
Hey,
I'm beginner in processing and my problem is, that I can't assign every letter a special sign (p.e. an ellipse for the letter "e" and a rectangle for the letter "f"). I want that the letters have the same order as they are in the text document.It should be a symbol translation of a text. For example it could look like this:
The current code I have:
String lines[];
void setup(){
size(200, 200);
lines = loadStrings("tell.txt");
}
void draw(){
for(int i=0; i < lines.length; i++){
for(int j=0; j < lines[i].length(); j++){
String letter = lines[i].substring(j, j+1);
if(letter.contains("e")){
println("e");
}
if(letter.contains("f")){
println("f");
}
if(letter.contains("t")){
println("t");
}
}
}
}
I realy hope you can help me. It's for a school project. Thanks a lot!
Julia
The current code I have:
String lines[];
void setup(){
size(200, 200);
lines = loadStrings("tell.txt");
}
void draw(){
for(int i=0; i < lines.length; i++){
for(int j=0; j < lines[i].length(); j++){
String letter = lines[i].substring(j, j+1);
if(letter.contains("e")){
println("e");
}
if(letter.contains("f")){
println("f");
}
if(letter.contains("t")){
println("t");
}
}
}
}
I realy hope you can help me. It's for a school project. Thanks a lot!
Julia
1
