Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incomplete winning horse positions #1

Open
inglorious-ratbastard opened this issue Nov 27, 2020 · 0 comments
Open

incomplete winning horse positions #1

inglorious-ratbastard opened this issue Nov 27, 2020 · 0 comments
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@inglorious-ratbastard
Copy link
Owner

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);
        }
    }
@inglorious-ratbastard inglorious-ratbastard added bug Something isn't working invalid This doesn't seem right labels Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant