def is_nocontact_strict(matchid): points = gg.position_id_to_points(matchid) player1points = points[25:] player2points = points[:25] player1mostbackward = points_to_most_backward(player1points) player2mostbackward = points_to_most_backward(player2points) if player1mostbackward + player2mostbackward <= 22: return True
def is_holdingopp(matchid): if gc.is_nocontact(matchid): return False points = gamerep.position_id_to_points(matchid)[:25] opp_pips, player_pips = gamerep.position_id_to_pips(matchid) board = points[-8:-3] if (sum(1 for point in board if point >= 2) == 1 and opp_pips - player_pips >= 55): return True
def is_backgameopp(matchid): if gc.is_nocontact(matchid): return False points = gamerep.position_id_to_points(matchid)[:25] opp_pips, player_pips = gamerep.position_id_to_pips(matchid) board = points[-7:-1] if (sum(1 for point in board if point >= 2) >= 2 and opp_pips - player_pips >= 55): return True
def is_bearoffopp(matchid): points = gg.position_id_to_points(matchid)[:25] if sum(points[6:]) == 0: return True