A Day At The Races: Being Fair

  • Please log in to reply
No replies to this topic

#1 svHFCs


    New Member

  • Members
  • Pip
  • 8 posts

Posted 02 September 2014 - 04:39 AM

I've posted my frustrations, I should at least post my support. This is totally for the sake of the game more so than for the lesson.

I enhanced the timer_click code for the dog race. You may disagree, but I didn't really feel that the dog race was fair in the fact that though a dog may have a random number of steps to determine its progress, it should also be random on which dog that progress is applied. For example, we have seen many types of races in real life, like horses, where the horses are ahead then behind then ahead again etc. However, we have also seen the horse that comes in from the back during the last lap and wins. This enhancement allows for that possiblity and makes the game less predictable and more fun. However, in the case of the dogs, what if two dogs both need 4 steps to win (say, dog 1 and 2), and the next random number is 4? I don't think dog 1 should win just because it is next in the sequence of the dogs but both should have an equal chance. So I added a randomizer for the dogs chosen for the random steps. The first 3 lines are my enhancement.

            int iDog;
            iDog = MyRandomizer.Next(0, 4);

            if (greyhound[iDog].MyPictureBox.Right >= (raceTrackPictureBox.Width - 50))
                MessageBox.Show("Dog #" + (iDog + 1) + " won the race!", "We have a winner", MessageBoxButtons.OK);
                foreach (Greyhound dog in greyhound)
                foreach (Guy guy in guys)
                    guy.Collect(iDog + 1);
                    guy.myRadioButton.Enabled = true;
                betsButton.Enabled = true;

Edited by svHFCs, 02 September 2014 - 04:42 AM.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users