Text random program
in
Programming Questions
•
1 month ago
Hello I would like to do an automaitc program wich write no sense text with all the characters of the
ASCII keyboard that i'm using, i've started, and i have a manual program wich is:
char letter;
String words = "Begin...";
void setup() {
size(640, 360);
// Create the font
textFont(createFont("Georgia", 36));
}
void draw() {
background(0); // Set background to black
// Draw the letter to the center of the screen
textSize(14);
text("Click on the program, then type to add to the String", 50, 50);
text("Current key: " + letter, 50, 70);
text("The String is " + words.length() + " characters long", 50, 90);
textSize(36);
text(words, 50, 120, 540, 300);
}
void keyPressed() {
// The variable "key" always contains the value
// of the most recent key pressed.
if ((key >= 'A' && key <= 'z') || key == ' ') {
letter = key;
words = words + key;
// Write the letter to the console
print(key);
}
}
I can't write numbers and the rest of symbols.
Do you have any idea to continue with my proyect? I would like also to make it automatic,
i don't need it in the screen i just need some text with no sense made by a program, I thought having
all this text in the print part of processing!
THANK YOU!
ASCII keyboard that i'm using, i've started, and i have a manual program wich is:
char letter;
String words = "Begin...";
void setup() {
size(640, 360);
// Create the font
textFont(createFont("Georgia", 36));
}
void draw() {
background(0); // Set background to black
// Draw the letter to the center of the screen
textSize(14);
text("Click on the program, then type to add to the String", 50, 50);
text("Current key: " + letter, 50, 70);
text("The String is " + words.length() + " characters long", 50, 90);
textSize(36);
text(words, 50, 120, 540, 300);
}
void keyPressed() {
// The variable "key" always contains the value
// of the most recent key pressed.
if ((key >= 'A' && key <= 'z') || key == ' ') {
letter = key;
words = words + key;
// Write the letter to the console
print(key);
}
}
I can't write numbers and the rest of symbols.
Do you have any idea to continue with my proyect? I would like also to make it automatic,
i don't need it in the screen i just need some text with no sense made by a program, I thought having
all this text in the print part of processing!
THANK YOU!
1