Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Mr.Makenzie i need help on array- horse odds and betting
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Ayoun




PostPosted: Sun Mar 06, 2005 12:25 pm   Post subject: Mr.Makenzie i need help on array- horse odds and betting

Sir i have no idea how to get different odds for each horse
Ayoun
Sponsor
Sponsor
Sponsor
sponsor
person




PostPosted: Sun Mar 06, 2005 1:42 pm   Post subject: (No subject)

ok...even though im not mackenzie i actually did a horse betting game (its in the submissions area)...can u be a little more specific with ur question because id like to help
Ayoun




PostPosted: Sun Mar 06, 2005 3:06 pm   Post subject: Reply

ok you know when we are suppost to make a horse race with each horse having a different odd of winning a game. yeah i dont know how to cange the odds for each horse, right not each horse has a 1 in 6 chances of winning a race. in total there are 6 horses
Flikerator




PostPosted: Sun Mar 06, 2005 3:14 pm   Post subject: (No subject)

If you wanted to ask mackenzie, send him a pm?

I havnt made a horse betting program, but it doesnt seem that difficult. Just use Rand.Int or something. Im not entirely sure what you want (so I cant give suggestions), but if you need any help with something just ask. Its helpful if you also post the code you need help with.
McKenzie




PostPosted: Sun Mar 06, 2005 4:16 pm   Post subject: (No subject)

PM might be the best way to handle this, but There may be others who are asking themselves the same question.

So I've decided to run Starcraft after school again. This time I'm doing it as a way to make some extra money by setting up a gambling house. In order for the betting odds to be fair I need to do some testing. I take my players, lets say Andy, Raymond, AsianSensation, Bugz and "make" them play 100 games. I then tally the wins.
code:

Name            Wins   
-----------------------------
Andy :          25         
Raymond:        45         
AsianSensation: 25           
Bugz:            5         

As you can see, on average Andy wins 1 in every 4 game. If someone were to bet on Andy I should pay them $4 for every $1 they bet (if I was totally fair). So my chart would look like:

code:
Name            Wins    100 div Wins (pay rate)
-------------------------------------------
Andy :          25           4
Raymond:        45           2
AsianSensation: 25           4
Bugz:            5          20

In this example I would be making money on the round-off error because even though Raymond wins less than one in every two that is the pay rate.

Obviously the same principle applies to your horse racing. First figure out some way of advancing your horses so that each horse has a different chance of winning. Once you have done this run your program 1000 times (without graphics) and count how many times each horse wins. Compute 1000 div wins and you will have your pay rates. PM me your code if you are still confused and I will set you in the right direction.
person




PostPosted: Sun Mar 06, 2005 6:15 pm   Post subject: (No subject)

wat u can do is do this:

code:

loop
       a:=Rand.Int (1..10)
       b:=Rand.Int (1..20)
       c:=Rand.Int (1..30)
       drawdot (1+a,10,1)
       drawdot (1+b,20,1)
       drawdot (1+c,30,1)
end loop
McKenzie




PostPosted: Sun Mar 06, 2005 6:39 pm   Post subject: (No subject)

Ignoring all of the obvious errors in the code the problem with that is c would always win the race.
person




PostPosted: Sun Mar 06, 2005 6:45 pm   Post subject: (No subject)

not really and any ways my numbers r a little exagerated
Sponsor
Sponsor
Sponsor
sponsor
McKenzie




PostPosted: Sun Mar 06, 2005 7:04 pm   Post subject: (No subject)

Even if you change the range to say (1,10), (1,11), (1,12) a will win about 1%, b about 19% and c about 80%. This is on a 500 pixel long track. The odds get worse as the track gets longer obviously.
Andy




PostPosted: Sun Mar 06, 2005 7:11 pm   Post subject: (No subject)

what?? i am teh pwnzord by raymond?? thats it.. time to practice lol
person




PostPosted: Sun Mar 06, 2005 7:41 pm   Post subject: (No subject)

u can have a constant Randint and a none constant one
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 11 Posts ]
Jump to:   


Style:  
Search: