How would I get a user inputted string to do something based on the string inputted?
in
Programming Questions
•
1 year ago
For example, if the user types in the word "hello", how would I get the application to draw a box, whereas they typed the word "goodbye", it would draw a triangle?
My code isn't really needed to answer the question, but here it is:
void setup() {
size(400, 400);
background(#3355CC);
}
void mouseReleased() {
background(125);
}
void draw () {
}
void keyPressed() {
fill(#FFE200);
textSize(random(100, 200));
text(key, random(300), random(100, 400));
print(key);
}
1