Beispiel #1
0
        public JoBmoves GetValidateMove()
        {
            JoBmoves move = GetMove();

            if (_actions.Contains(move.move))
            {
                return(move);
            }
            else
            {
                throw new Exception("Logic error");
            }
        }
Beispiel #2
0
        public JoBmoves GetMove()
        {
            if (_actions.Count() == 1 && _actions[0] == Actions.BET)
            {
                return(new JoBmoves()
                {
                    move = _actions[0], hold = null
                });
            }
            else if (_actions.Count() == 1 && _actions[0] == Actions.STAND)
            {
                JoBmoves move = new JoBmoves()
                {
                    move = Actions.STAND, hold = _selectors
                };

                if (isRoyalFlush())
                {
                    move.hold = _selectors;
                    return(move);
                }
                if (isFlush())
                {
                    move.hold = _selectors;
                    return(move);
                }
                if (isFourOfAKind())
                {
                    move.hold = _selectors;
                    return(move);
                }

                if (Is4ToRoyalFlush())
                {
                    move.hold = _selectors;
                    return(move);
                }

                if (isFullHouse())
                {
                    move.hold = _selectors;
                    return(move);
                }

                if (isFlush())
                {
                    move.hold = _selectors;
                    return(move);
                }

                if (isThreeOfAKind())
                {
                    move.hold = _selectors;
                    return(move);
                }

                if (isStraight())
                {
                    move.hold = _selectors;
                    return(move);
                }

                if (is4ToStraightFlush())
                {
                    move.hold = _selectors;
                    return(move);
                }

                if (isTwoPair())
                {
                    move.hold = _selectors;
                    return(move);
                }
                if (isJacksOrBetter())
                {
                    move.hold = _selectors;
                    return(move);
                }

                if (Is3ToRoyalFlush())
                {
                    move.hold = _selectors;
                    return(move);
                }

                if (Is4ToFlush())
                {
                    move.hold = _selectors;
                    return(move);
                }

                if (is4ToStraight())
                {
                    move.hold = _selectors;
                    return(move);
                }
                if (isLowPair())
                {
                    move.hold = _selectors;
                    return(move);
                }

                if (is4_to_outside_straight_0To2_high_cards())
                {
                    move.hold = _selectors;
                    return(move);
                }

                if (is1JackOrBetter())
                {
                    move.hold = _selectors;
                    return(move);
                }
                if (is3ToStraightFlush())
                {
                    move.hold = _selectors;
                    return(move);
                }

                _selectors = new int[5] {
                    0, 0, 0, 0, 0
                };
                move.hold = _selectors;
                return(move);


                //Suited QJ (0.6004)B
                //4 to an inside straight, 4 high cards (0.5957)
                //Suited KQ or KJ (0.5821)
                //Suited AK, AQ, or AJ (0.5678)
                //4 to an inside straight, 3 high cards (0.5319)
                //3 to a straight flush (type 2) (0.5227 to 0.5097)C
                //Unsuited JQK (0.5005)
                //Unsuited JQ (0.4980)
                //Suited TJ (0.4968) D
                //2 unsuited high cards king highest (0.4862)
                //Suited TQ (0.4825) E
                //2 unsuited high cards ace highest (0.4743)
                //J only (0.4713)
                //Suited TK (0.4682) F
                //Q only (0.4681)
                //K only (0.4649)
                //A only (0.4640)
                //3 to a straight flush (type 3) (0.4431)
                //Garbage, discard everything (0.3597)
            }
            throw new Exception("Logic error");
        }