I'm working on a horse race. So in my program, a random number is produced. This random number can be 1 through 100. If the random number is 1-35, then horse one will be the winner. If the random number is 36-47, then horse two will be the winner. It goes on like this for nine horses, each with different odds of winning. I then have to save the winner of each race in an array. So say that, race 1, horse 2 wins. So the array will say 2-1. Race 2, horse three wins, so then it will be 2-1, 3-1, so horse 2 has won once, and horse 3 has won once. Then race 3, horse 2 wins again. So then it would be 2-2, 3-1. How would I do this in an array?
samii1017 0 Newbie Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
samii1017 0 Newbie Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.