The issue is - when a fight starts, i want to take the array of enemies and combine any names that match and show the number of them...
Code: Select all
Bill
Ted 3
Rufus
Napoleon 2
Below is the code idea that ive been throwing around trying to figure this out, but I just dont know what to do
Code: Select all
string names[6];
loop into names array
skip any names == "null";
if string at names[LOOP_NUMBER] matches the same string at another spot in the array
print names[LOOP_NUMBER] HOW_MANY_TIMES_THAT_NAME_APPEARS_IN_ARRAY
else if (no matches)
print names[LOOP_NUMBER]