Beispiel #1
0
        public void Play()
        {
            int nDecision = 0;
            OutcomesBaccaratCoup result = OutcomesBaccaratCoup.None;

            aResultBaccaratShoe = new ResultBaccaratShoe();

            while (true)
            {
                result = PlayACoup();
                if (OutcomesBaccaratCoup.End == result)
                {
                    break;
                }

                if (OutcomesBaccaratCoup.None == result)
                {
                    continue;
                }

                aResultBaccaratCoup.IndexDecision = ++nDecision;
                aResultBaccaratCoup.OutcomeCoup   = result;

                Results.Add(aResultBaccaratCoup);
                aResultBaccaratCoup = new ResultBaccaratCoup();
            }
        }
Beispiel #2
0
        public void ScoreLoss(int aUnitBet, OutcomesBaccaratCoup betPlacement)
        {
            NumberBet++;
            UnitBet  += aUnitBet;
            UnitLoss += aUnitBet;

            ThisLoss = (decimal)Constants.UnitLossPayoff * aUnitBet;

            DollarLoss += ThisLoss;
            TotalScore -= ThisLoss;

            switch (betPlacement)
            {
            case OutcomesBaccaratCoup.B:
                NumberBankerLoss++;
                UnitBankerLoss += aUnitBet;
                break;

            case OutcomesBaccaratCoup.P:
                NumberPlayerLoss++;
                UnitPlayerLoss += aUnitBet;
                break;

            case OutcomesBaccaratCoup.T:
                NumberTieLoss++;
                UnitTieLoss += aUnitBet;
                break;

            default:
                break;
            }

            SetMaxLoss();
        }
Beispiel #3
0
        private OutcomesBaccaratCoup StrategyCore_RepeatN(int i, List <ResultBaccaratCoup> results, ScoreBaccarat scoreShoe, decimal sessionTotalScore, BetProgressionCore betProgression, MoneyManagementShoe mmShoe, MoneyManagementBankroll mmBankroll)
        {
            if (i < CustomRepeat_Length)
            {
                return(OutcomesBaccaratCoup.Continue);
            }

            OutcomesBaccaratCoup outcomeN = results[i - CustomRepeat_Length].OutcomeCoup;

            if (outcomeN == OutcomesBaccaratCoup.T)
            {
                return(OutcomesBaccaratCoup.Continue);
            }

            if (MoneyManager(scoreShoe.TotalScore, sessionTotalScore, betProgression, mmShoe, mmBankroll))
            {
                return(OutcomesBaccaratCoup.Break);
            }

            ResultBaccaratCoup result = results[i];

            OutcomesBaccaratCoup betPlacement = outcomeN;

            result.CoupBet.BetPlacement = betPlacement;
            result.CoupBet.UnitBet      = NextBet;

            OutcomesBaccaratCoup outcome = result.OutcomeCoup;

            if (betPlacement == outcome)
            {
                if (outcome == OutcomesBaccaratCoup.B)
                {
                    scoreShoe.ScoreBankerWin(NextBet);
                }
                else
                {
                    scoreShoe.ScorePlayerWin(NextBet);
                }

                result.OutcomeBet = OutcomesLastCoupBet.Win;
                LastBetResult     = OutcomesLastCoupBet.Win;
            }
            else
            {
                if (outcome == OutcomesBaccaratCoup.T)
                {
                    result.OutcomeBet = OutcomesLastCoupBet.Push;
                    LastBetResult     = OutcomesLastCoupBet.Push;
                }
                else
                {
                    scoreShoe.ScoreLoss(NextBet, betPlacement);

                    result.OutcomeBet = OutcomesLastCoupBet.Loss;
                    LastBetResult     = OutcomesLastCoupBet.Loss;
                }
            }

            return(betPlacement);
        }
Beispiel #4
0
        private OutcomesBaccaratCoup StrategyCore_TieAlways(int i, List <ResultBaccaratCoup> results, ScoreBaccarat scoreShoe, decimal sessionTotalScore, BetProgressionCore betProgression, MoneyManagementShoe mmShoe, MoneyManagementBankroll mmBankroll)
        {
            if (MoneyManager(scoreShoe.TotalScore, sessionTotalScore, betProgression, mmShoe, mmBankroll))
            {
                return(OutcomesBaccaratCoup.Break);
            }

            ResultBaccaratCoup result = results[i];

            OutcomesBaccaratCoup betPlacement = OutcomesBaccaratCoup.T;

            result.CoupBet.BetPlacement = betPlacement;
            result.CoupBet.UnitBet      = NextBet;

            OutcomesBaccaratCoup outcome = result.OutcomeCoup;

            if (outcome == OutcomesBaccaratCoup.T)
            {
                scoreShoe.ScoreTieWin(NextBet);

                result.OutcomeBet = OutcomesLastCoupBet.Win;
                LastBetResult     = OutcomesLastCoupBet.Win;
            }
            else
            {
                scoreShoe.ScoreLoss(NextBet, betPlacement);

                result.OutcomeBet = OutcomesLastCoupBet.Loss;
                LastBetResult     = OutcomesLastCoupBet.Loss;
            }

            return(betPlacement);
        }
Beispiel #5
0
        private void StrategyWrapper(List <ResultBaccaratCoup> results, ScoreBaccarat scoreShoe, decimal sessionTotal, MoneyManagementShoe mmShoe, MoneyManagementBankroll mmBankroll)
        {
            OutcomesBaccaratCoup outcome = OutcomesBaccaratCoup.None;

            for (int i = 0; i < results.Count; i++)
            {
                outcome = MyStrategy[0].StrategyCore(i, results, scoreShoe, sessionTotal + scoreShoe.TotalScore, MyBetProgression[0].BetProgressionCore, mmShoe, mmBankroll);

                if (outcome == OutcomesBaccaratCoup.None || outcome == OutcomesBaccaratCoup.Continue)
                {
                    outcome = MyStrategy[1].StrategyCore(i, results, scoreShoe, sessionTotal + scoreShoe.TotalScore, MyBetProgression[1].BetProgressionCore, mmShoe, mmBankroll);

                    if (outcome == OutcomesBaccaratCoup.None || outcome == OutcomesBaccaratCoup.Continue)
                    {
                        outcome = MyStrategy[2].StrategyCore(i, results, scoreShoe, sessionTotal + scoreShoe.TotalScore, MyBetProgression[2].BetProgressionCore, mmShoe, mmBankroll);

                        if (outcome == OutcomesBaccaratCoup.None || outcome == OutcomesBaccaratCoup.Continue)
                        {
                            outcome = MyStrategy[3].StrategyCore(i, results, scoreShoe, sessionTotal + scoreShoe.TotalScore, MyBetProgression[3].BetProgressionCore, mmShoe, mmBankroll);
                        }
                    }
                }

                if (outcome == OutcomesBaccaratCoup.Break)
                {
                    break;
                }

                results[i].TotalDollarScore = scoreShoe.TotalScore;
            }
        }
Beispiel #6
0
        /// <summary>
        /// PrepareStreaks
        /// Set up CustomPattern strategy parameters for streaks
        /// </summary>
        private void PrepareCustomPatternForStreaks()
        {
            CustomPattern_Pattern = new OutcomesBaccaratCoup[Streaks_Length];

            for (int i = 0; i < Streaks_Length; i++)
            {
                CustomPattern_Pattern[i] = Streaks_Target;
            }

            CustomPattern_BetPlacement = Streaks_BetPlacement;
            CustomPattern_Length       = Streaks_Length;
        }
Beispiel #7
0
        private OutcomesBaccaratCoup StrategyCore_None(int i, List <ResultBaccaratCoup> results, ScoreBaccarat scoreShoe, decimal sessionTotalScore, BetProgressionCore betProgression, MoneyManagementShoe mmShoe, MoneyManagementBankroll mmBankroll)
        {
            if (MoneyManager(scoreShoe.TotalScore, sessionTotalScore, betProgression, mmShoe, mmBankroll))
            {
                return(OutcomesBaccaratCoup.Break);
            }

            ResultBaccaratCoup result = results[i];

            OutcomesBaccaratCoup betPlacement = OutcomesBaccaratCoup.None;

            result.CoupBet.BetPlacement = betPlacement;
            result.CoupBet.UnitBet      = NextBet;

            return(betPlacement);
        }
Beispiel #8
0
        public static OutcomesBaccaratCoup[] ParseBetPlacementString(string inputString)
        {
            int stringLength = inputString.Length;

            OutcomesBaccaratCoup[] betPlacements = new OutcomesBaccaratCoup[stringLength];

            char[] placements = inputString.ToUpper().ToCharArray();

            int i = 0;

            foreach (char placement in placements)
            {
                Constants.BetPlacementDictionary.TryGetValue(placement, out betPlacements[i++]);
            }

            return(betPlacements);
        }
Beispiel #9
0
        public void UtilitiesTest_ParseBetPlacementString_Test()
        {
            string inputString = "pbbttppp";

            OutcomesBaccaratCoup[] expected = new OutcomesBaccaratCoup[] { OutcomesBaccaratCoup.P,
                                                                           OutcomesBaccaratCoup.B,
                                                                           OutcomesBaccaratCoup.B,
                                                                           OutcomesBaccaratCoup.T,
                                                                           OutcomesBaccaratCoup.T,
                                                                           OutcomesBaccaratCoup.P,
                                                                           OutcomesBaccaratCoup.P,
                                                                           OutcomesBaccaratCoup.P, };

            OutcomesBaccaratCoup[] actual = Utilities.ParseBetPlacementString(inputString);

            CollectionAssert.AreEqual(expected, actual);
        }
Beispiel #10
0
        private OutcomesBaccaratCoup StrategyCore_Follow(int i, List <ResultBaccaratCoup> results, ScoreBaccarat scoreShoe, decimal sessionTotalScore, BetProgressionCore betProgression, MoneyManagementShoe mmShoe, MoneyManagementBankroll mmBankroll)
        {
            if (i < Follow_Length)
            {
                Follow_BetPlacement = OutcomesBaccaratCoup.None;
                return(OutcomesBaccaratCoup.Continue);
            }

            int j = 1;
            OutcomesBaccaratCoup lastOutcome = results[i - j].OutcomeCoup;

            for (; j < Follow_Length; j++)
            {
                if (results[i - j - 1].OutcomeCoup != lastOutcome)
                {
                    break;
                }
            }

            if (j == Follow_Length)
            {
                if (lastOutcome != OutcomesBaccaratCoup.T)
                {
                    Follow_BetPlacement = lastOutcome;
                }
            }

            if (Follow_BetPlacement != OutcomesBaccaratCoup.None)
            {
                if (MoneyManager(scoreShoe.TotalScore, sessionTotalScore, betProgression, mmShoe, mmBankroll))
                {
                    return(OutcomesBaccaratCoup.Break);
                }

                ResultBaccaratCoup result = results[i];

                OutcomesBaccaratCoup betPlacement = Follow_BetPlacement;

                result.CoupBet.BetPlacement = betPlacement;
                result.CoupBet.UnitBet      = NextBet;

                OutcomesBaccaratCoup outcome = result.OutcomeCoup;

                if (outcome == betPlacement)
                {
                    if (outcome == OutcomesBaccaratCoup.B)
                    {
                        scoreShoe.ScoreBankerWin(NextBet);
                    }
                    else if (outcome == OutcomesBaccaratCoup.P)
                    {
                        scoreShoe.ScorePlayerWin(NextBet);
                    }
                    else if (outcome == OutcomesBaccaratCoup.T)
                    {
                        scoreShoe.ScoreTieWin(NextBet);
                    }

                    result.OutcomeBet = OutcomesLastCoupBet.Win;
                    LastBetResult     = result.OutcomeBet;
                }
                else
                {
                    if (outcome == OutcomesBaccaratCoup.T)
                    {
                        if (CustomPattern_BetPlacement != OutcomesBaccaratCoup.T)
                        {
                            result.OutcomeBet = OutcomesLastCoupBet.Push;
                            LastBetResult     = result.OutcomeBet;
                        }
                    }
                    else
                    {
                        scoreShoe.ScoreLoss(NextBet, betPlacement);

                        result.OutcomeBet = OutcomesLastCoupBet.Loss;
                        LastBetResult     = result.OutcomeBet;
                    }
                }
            }

            return(Follow_BetPlacement);
        }
Beispiel #11
0
 public Bet(OutcomesBaccaratCoup betPlacement, int unitBet)
 {
     BetPlacement = betPlacement;
     UnitBet      = unitBet;
 }