I have an array and I want to implement FIFO. my project consist of 5 games and a score for each individual game. I had already coded it. heres my code:
if (Game.isNewScore) {
for (int i = 0; i < 5; i++) {
if (addition[i] == 0) {
addition[i] = Game.score;
break;
}
}
}
now my problem is when Im already in the sixth game the scoring should replace the score in the 1st game then transfering the scores from left but it seems the score from the game 6
is not showing.
e.g
2 4 6 8 9 - scores
1 2 3 4 5 - no. of Games
when on sixth game
4 6 8 9 (new score)
can someone teach me on this kind of logic? when you seems not getting my point please tell me. Im badly needing a help. thanks