I have an array filled with ones and zeros, also i have two LED (1 = Left LED / 0 = Right LED )
int Game[100]
And I have an array where I write user actions ( Using joystick ). (( The initial thought with this array was to constantly increase its size by one ... but I read that you can’t do this and you need to implement a “Linked list”, but for now, okay. ))
int Player[2]
I want to go through all the elements of the array "Game", but only through one element
int i;
for(i = 0; i <= 100; i++) {
if(Game[i] == 1) {
// Left LED ON
// Left LED OFF
}
else if (Game[i] == 0) {
// Right LED ON
// Right LED ON
}
I mean, first I want to take two elements from the array, turn on the LEDs...wait for user input... then take another element (Repeat the first two ) and so on. Is there any way i can do this ?