Wednesday, 15 September 2010

c# - Fill poker pots -


Basically a table and player A has increased to $ 100, player B calls (accepts), player C only 50 Dollars are therefore made as vessels for $ 100 (between player A and B) and $ 150 (all chips in between $ 50 for all players).

How do I implement such a function and all the utensils properly? This is what I have done so far:

  Fixed public zero FillPots (cell, decimal valve, int player) {decimal NewRaise = Val; If (Newrise> 0) {Foreign (program player pays in R. set) {if (pz == null) {continue; } If (pz.BuyIn & lt; NewRaise) {pot_pot = new pot {potsez = r. Maxplayer, Portbew = (Nwirez - PJ. Buine), Potvell = New Decimal [R. Maxplayer]}; Array Clear (_pot.wallwell, 0, R. Maxplayer); R.Pots.Add (_pot); Newrise - = (Newrise - Pez. Buine); }}} For (int i = 0; i & lt; r.pots.Count; i ++) {if (r.Pots [i]. Portwell [player] == 0m & newrise & gt; Potts [I]. Potbie) {R. Potts [I]. Portwell [Player] + = R. Pots [I] .ptbew; Nwrise - = R. Pots [I] .ptbew; }} If (neurize> gt; 0) {pot_pot = new pot {pot siz = r. Maxplayer, Portbuy = (Nwiris), Portwell = new decimal [R. Maxplayer]}; Array Clear (_pot.wallwell, 0, R. Maxplayer); _pot.PotVal [Player] + = NewRaise; R.Pots.Add (_pot); Nwrise = 0; }}   

It is very misleading to keep the position of the player of each person important than the player's number within the array.

I can not talk to C #, but when you do not have any answer here, then I In general you can tell how to handle poker utensils are two ways: pot-centric and player-centric I normally like the latter because there is less data for management.

You need a variable for "joint utensil" (let's call it a pot), a variable for the "current total sum amount" (CBET), the amount of last lifting for each player (LRAISE) and three variables: steak (PSTAC [N]), "current condition" (PBET [N]), "contribution to the pot" (PContriIB [N]).

When hand is handled, then set the pot and the PCOntRIB [0] of each player. If there are ants, then add them to the pot and to each player's PCTRIB [], remove them from PSTACE [].

At the beginning of every betting phase, set with CBET, LARAIIS and all PBET [0]. If this is the first round, and blind, then set PBET [] of those players in blind volume, remove them PST []

Each player has three options: (1) times (if you have CB ET 0 you would like to reject it), (2) Call, in which case he will have to make his PBET [] CBET Equivalent to (if CBET is 0, it is called "check", otherwise the amount of call is CBET-PBET []), which must be freed by PBET [] from OM PSTAC []). (3), in which the player should increase the CBT amount by at least the LRAIES (and the other bands, following the amount of new LARIES to be followed), transfer the required amount from its shareholding. Note: You should also remember who was the last raiser, so that he is not allowed to raise himself.

If the player's share is inadequate to call or increase, then he should take his whole piece in his PBET "if in all" (if allowed otherwise) [] when all the players have given CBET If you have called or have gone in all, then the betting period is over. If a player has picked up, then all the others have been added, and there is no one else, then just give the pot to the dishes, otherwise for each player, your PATAT [] in your PCOSTRIB [] and POT Add it.

If the hand continues to show, then give prizes to such utensils: Start with the best hands: His winning amount (W) is his PC host [] Go to each player (including him) Subtract at least W of the pot and PC player of that player [] and award it to the winner. Remove the winner from the player list, remove any player whose PCONTRIB [0] is now 0, and continue with the next best hand. Remove that winner, etc., and continue until the pot is not 0.


I think the pot-centric method is more complex. Instead of keeping each player's contribution, you keep a list of central utensils and side pots, and the list of players involved in that vessel for each vessel (can be many utensils in the form of players) Instead of outside the vessel is honored with out-of-the-box. It is more about how dealers are taught to do this in the real game.

No comments:

Post a Comment