Reverse string array
in
Programming Questions
•
1 month ago
I'm trying to learn how to program and I'm wondering how to reverse my string array. Here's my code so far.
String[] words = {
"if", "you", "have", "a", "set", "of", "bad", "eggs", "it's",
"likely", "you", "get", "a", "bad", "omelet"
};
int x = 30;
int wordSpacing = 22;
void setup() {
size(200, 280);
noLoop();
}
void draw() {
for (int i = 0; i < 10; i++) {
text(words[i].toUpperCase() + ": " + words[i].length() + " letters.", 10, x);
x = x + wordSpacing;
}
}
1