2D Array with Text / Strings
in
Programming Questions
•
7 months ago
Hey dudes and dudettes,
I'm trying to make a 2D array with Strings. I'd like to select the 1 stanza at a time (of 3 sentences), then separate them into individual lines later. I have no problem creating a 1D array but when I try to make it into a 2D String array I'm a bit confused.
My code for a 2D array looks like this -- obviously i'm going something wrong...
Strings [][] JayZlyrics = {
{"Back when Police was Al'Qaeda to black men",
"While I was out there hustling sinning with no religion",
"He was off the wall killing for a living"};
{"Rap harder like I'm part of a cult"
"Like Cuban cigar maker 'cept I'm hard to smoke"
"And y'all choke motherfuckers"},
{"Friend or Foe, y'all all my muh' fuckers"
"If you haven't heard, I'm Michael Magic and Bird"
"all rolled in one - cause none got more flows than Young"},
};
text(JayZlyrics[1][0], 10, 0); // want to select select second stanza, 1st line
text(JayZlyrics[1][1],10, 20); // want to select select second stanza, 2nd line
text(JayZlyrics[1][2], 10, 40); // want to select select second stanza, 3rd line
Sounds easy enough, I just forgot my brain.
Thanks for your help!
/d
1