Calculating quantity required to reach an amount

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Re: Calculating quantity required to reach an amount

Post by VegasNath »

dasadler wrote:@Nathan: ....Although Texas Hold 'Em Poker (which has blinds) is a popular poker game, it is one of several we play and I was trying to come up with a solution that would apply to any flavor of poker.
There are other flavors? :evilgrin: I've led a sheltered life! :smile:
:wales: Nathan :uk:
There's no place like home.....

dasadler
5StarLounger
Posts: 889
Joined: 25 Jan 2010, 16:26
Location: Garden Grove, CA 92844 USA

Re: Calculating quantity required to reach an amount

Post by dasadler »

Okay. Thanks for your help. I will continue to work with it. What is have is fine except that is skips the yellow chip completely. I would prefer that the player receive two yellow chips rather than skip the yellow and receive one purple. Maybe it would make more sense if I revise my previous statements to say:

1) presuming the chip value is greater than or equal to the minimum wager:
2) give enough whites to equal one red. [in this case, no white chip is given, see #1]
3) give enough reds such that along with the whites already distributed, it equals one green.
4) give enough greens such that along with the whites and reds already distributed, it equals one black.
5) give enough blacks such that along with the whites, reds, and greens already distributed, it equals one yellow OR the starting amount, whichever comes first.
6) give enough yellows such that along with the whites, reds, greens, and blacks already distributed, it equals one purple OR the starting amount, whichever comes first.
7) give enough purples such that along with the whites, reds, greens, blacks, and yellows already distributed, it equals the starting amount.
Don

User avatar
HansV
Administrator
Posts: 78530
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Calculating quantity required to reach an amount

Post by HansV »

Once again, I don't see how that would work. Perhaps someone else will have a bright idea.
Best wishes,
Hans

dasadler
5StarLounger
Posts: 889
Joined: 25 Jan 2010, 16:26
Location: Garden Grove, CA 92844 USA

Re: Calculating quantity required to reach an amount

Post by dasadler »

What do you see as the problem or reason it won't work? I am curious as to what I am missing in understanding this.
Don

User avatar
HansV
Administrator
Posts: 78530
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Calculating quantity required to reach an amount

Post by HansV »

If you go from small to large, you're likely to end with a remaining amount that requires smaller units again. Let's say the starting amount is $1262.

We begin with 5 x $1 = $5
Add 4 x $5 to arrive at $25
Add 3 x $25 to arrive at $100
Add 4 x $100 to arrive at $500
Add 1 x $500 to arrive at $1000
We still have $262 to distribute but we can't use a purple $1000 chip for that! What now?
Best wishes,
Hans

dasadler
5StarLounger
Posts: 889
Joined: 25 Jan 2010, 16:26
Location: Garden Grove, CA 92844 USA

Re: Calculating quantity required to reach an amount

Post by dasadler »

I understand that that is part of my dilemma. Couple of things, though, the starting amount will always be a multiple of 100 (most likely a multiple of 1000).

Still, it is possible it could be 1200. In this case, there would need to be an additional two black chips distributed. I don't know how to accommodate this in a formula. It might be better done as a recursive macro.

Also, we have been using large numbers but it would be nice if a home player could use this for say a $20 buy in for a weekly game and the chip values would have very low values... ,05, .10, ,25, etc.
Don

User avatar
HansV
Administrator
Posts: 78530
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Calculating quantity required to reach an amount

Post by HansV »

Smaller numbers in itself are not a problem - any algorithm should scale up or down.
Best wishes,
Hans

steveh
SilverLounger
Posts: 1952
Joined: 26 Jan 2010, 12:46
Location: Nr. Heathrow Airport

Re: Calculating quantity required to reach an amount

Post by steveh »

Morning

This is not an Excel solution but is a downloadable app. which seems to do what you want http://www.pokerdiy.com/poker-chip-calc ... urneySetup" onclick="window.open(this.href);return false; (but then again I don't know anything about poker so it would be up to you decide)

This site says it has a workbook to divvy up chips http://www.chiptalk.net/forum/chip-brea ... games.html" onclick="window.open(this.href);return false; but you need to be a forum member, might be worth having a look with a throwaway email addy
Steve
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin