What i want to do is write this, but in shorter:
if(bag[0] == 0) {
button1 = "Empty";
}
if(bag[1] == 0) {
button2 = "Empty";
}
if(bag[2] == 0) {
button3 = "Empty";
}
if(bag[3] == 0) {
button4 = "Empty";
}
if(bag[4] == 0) {
button5 = "Empty";
}
if(bag[5] == 0) {
button6 = "Empty";
}
if(bag[6] == 0) {
button7 = "Empty";
}
if(bag[7] == 0) {
button8 = "Empty";
}
if(bag[8] == 0) {
button9 = "Empty";
}
The array of bag[ ] is set to a max of 9 spots. So what i want to do is have it cycle from 0 to 8 to see if any of them are equal to 0, if so, mark the corresponding button as empty. I do not know the syntax for this, nor how to go about doing it, though it should be fairly simple solution for someone more experienced.