You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Race ends prematurely when first horse crosses the finish line not allowing all horses positions to be tracked in the winners circle. All horse finishing positions should be correctly be tracked and displayed at game end.
movement of horses across the track
for (int i = 0; i < horses; i++) {
if (numbers[i] >= 1 && numbers[i] <= 3) {
move[i]++;
} else if (numbers[i] == 4 && numbers[i] == 5) {
move[i] = move[i] + 3;
} else if (numbers[i] == 6) {
move[i] = move[i] + 5;
}
}
display of horses positions in winners circle
while (move[horses - 1] < tracks.length );
System.out.println("----------------------" + "\n\tWinners Circle" + "\n----------------------");
for (int i = 1; i <= horses; i++) {
if (move[i - 1] > tracks.length) {
System.out.println("HORSE " + i + " finished the track! One who bets for HORSE " + i + " won P" + betHorse[i - 1] * 2);
}
}
The text was updated successfully, but these errors were encountered:
Race ends prematurely when first horse crosses the finish line not allowing all horses positions to be tracked in the winners circle. All horse finishing positions should be correctly be tracked and displayed at game end.
movement of horses across the track
display of horses positions in winners circle
The text was updated successfully, but these errors were encountered: