I’m trying to write a loop that will generate a collection of new integer arrays based on the elements in a string ArrayList, but unfortunately Processing is having trouble calling the ArrayList in the definition of each array.
The problem seems to be that Processing doesn’t know I’m just trying to call the element in the ArrayList to name another Array.
StringList characs;
characs = new StringList();
characs.append(“Harry”);
characs.append(“Hermione”);
characs.append(“Ron”);
characs.append(“Hagrid”);
characs.append(“Dumbledore”);
characs.append(“Voldemort”);
characs.append(“Draco”);
characs.append(“Longbottom”);
characs.append(“McGonagall”);
characs.append(“Snape”);
characs.append(“Quirrell”);String item;
for (int a = 0; a <= characs.size(); a++) {
item = (characs.get(a));
item2 = (characs.get(a+1));
int[] string(item+'_ind') = new int[hp.length]; // Where string(item+'_var') would convert to something like 'Harry_ind' and a new integer array would be created.
int[] string(item+'_'+item2+'_ind') = new int[hp.length]; // Where string(item+'_'+item2+'_ind') would convert to something like 'Harry_Hermione_ind' and a new integer array would be created.
}
And, yes! I am trying to identify every time the different characters are mentioned in Harry Potter!
Much thanks for your help.