public PlayerAction GetAction(IDecisionContext ctx, EnchancedPlayer player) { var handStrenght = MonteCarloEvaluator.GetHandStrenght( ctx.FirstCard, ctx.SecondCard, ctx.CommunityCards); var currScore = handStrenght; if (ctx.TurnContext.RoundType == GameRoundType.River && currScore > 0.92m) { return(PlayerAction.Raise(2000)); } if (currScore > 0.85m) { player.LastHandStrenght = currScore; player.MyLastRaise = Math.Max(ctx.TurnContext.MoneyLeft / 4, (int)(player.MyLastRaise * (1 + currScore))); return(PlayerAction.Raise(player.MyLastRaise)); } if ((currScore > player.LastHandStrenght) && (currScore > 0.6m)) { player.LastHandStrenght = currScore; player.MyLastRaise = (int)(player.MyLastRaise * (1 + currScore)); return(PlayerAction.Raise(player.MyLastRaise)); } else { if (currScore > 0.6m) { var result = PlayerAction.CheckOrCall(); player.LastHandStrenght = currScore; return(result); } else { player.LastHandStrenght = currScore; if (ctx.TurnContext.CanCheck) { return(PlayerAction.CheckOrCall()); } return(PlayerAction.Fold()); } } }
public PlayerAction GetAction(IDecisionContext ctx, EnchancedPlayer player) { var handStrenght = MonteCarloEvaluator.GetHandStrenght( ctx.FirstCard, ctx.SecondCard, ctx.CommunityCards); var currScore = handStrenght; if (ctx.TurnContext.RoundType == GameRoundType.River && currScore > 0.92m) { return PlayerAction.Raise(2000); } if (currScore > 0.85m) { player.LastHandStrenght = currScore; player.MyLastRaise = Math.Max(ctx.TurnContext.MoneyLeft / 4, (int)(player.MyLastRaise * (1 + currScore))); return PlayerAction.Raise(player.MyLastRaise); } if ((currScore > player.LastHandStrenght) && (currScore > 0.6m)) { player.LastHandStrenght = currScore; player.MyLastRaise = (int)(player.MyLastRaise * (1 + currScore)); return PlayerAction.Raise(player.MyLastRaise); } else { if (currScore > 0.6m) { var result = PlayerAction.CheckOrCall(); player.LastHandStrenght = currScore; return result; } else { player.LastHandStrenght = currScore; if (ctx.TurnContext.CanCheck) { return PlayerAction.CheckOrCall(); } return PlayerAction.Fold(); } } }
public PlayerAction GetAction(IDecisionContext ctx, EnchancedPlayer player) { if (player.PocketStrength > 20 || ctx.FirstCard.Type == CardType.Ace || ctx.SecondCard.Type == CardType.Ace) { player.MyLastRaise = Math.Max(player.BigBlind, (int)(ctx.TurnContext.MoneyLeft * player.PocketRaisePercent)); return(PlayerAction.Raise(player.MyLastRaise)); } if (player.PocketStrength > 0 || ctx.TurnContext.CanCheck) { return(PlayerAction.CheckOrCall()); } else { var myBigBlinds = (int)Math.Ceiling(ctx.TurnContext.MoneyLeft / (ctx.TurnContext.SmallBlind * 2.0)); var bigBlindsToCall = (int)Math.Ceiling(ctx.TurnContext.MoneyToCall / (ctx.TurnContext.SmallBlind * 2.0)); if (myBigBlinds / bigBlindsToCall < 10) { return(PlayerAction.CheckOrCall()); } return(PlayerAction.Fold()); } }
public PlayerAction GetAction(IDecisionContext ctx, EnchancedPlayer player) { if (player.PocketStrength > 20 || ctx.FirstCard.Type == CardType.Ace || ctx.SecondCard.Type == CardType.Ace) { player.MyLastRaise = Math.Max(player.BigBlind, (int)(ctx.TurnContext.MoneyLeft * player.PocketRaisePercent)); return PlayerAction.Raise(player.MyLastRaise); } if (player.PocketStrength > 0 || ctx.TurnContext.CanCheck) { return PlayerAction.CheckOrCall(); } else { var myBigBlinds = (int)Math.Ceiling(ctx.TurnContext.MoneyLeft / (ctx.TurnContext.SmallBlind * 2.0)); var bigBlindsToCall = (int)Math.Ceiling(ctx.TurnContext.MoneyToCall / (ctx.TurnContext.SmallBlind * 2.0)); if (myBigBlinds / bigBlindsToCall < 10) { return PlayerAction.CheckOrCall(); } return PlayerAction.Fold(); } }