# -------------------------------------------------------------------- # preflop - the 2 hole cards. First stage in the game. # -------------------------------------------------------------------- # -------------------------------------------------------------------- # Elaborate preflop-strength based on hole cards. # # We may end up with multiple preflop-strength attributes. That's okay - # when we propose operators, the strongest preflop-strength will override # the weaker ones. # -------------------------------------------------------------------- # -------------------------------------------------------------------- # Pairs # -------------------------------------------------------------------- sp {preflop*elaborate*preflop-strength*pair-aces (state ^name preflop ^io.input-link.game ) ( ^card ^card ) ( ^type hole ^num 1 ^rank a) ( ^type hole ^num 2 ^rank a) --> ( ^preflop-strength 1) } sp {preflop*elaborate*preflop-strength*strong-pairs (state ^name preflop ^io.input-link.game ) ( ^card ^card ) ( ^type hole ^num 1 ^rank { << k q j t >> }) ( ^type hole ^num 2 ^rank ) --> ( ^preflop-strength 2) } sp {preflop*elaborate*preflop-strength*weak-pairs (state ^name preflop ^io.input-link.game ) ( ^card ^card ) ( ^type hole ^num 1 ^rank { <= 9 }) ( ^type hole ^num 2 ^rank ) --> ( ^preflop-strength 5) } # -------------------------------------------------------------------- # Suited cards - both hole cards are the same suit. # -------------------------------------------------------------------- sp {preflop*elaborate*preflop-strength*ace-king-suited (state ^name preflop ^io.input-link.game ) ( ^card ^card ) ( ^type hole ^suit ^rank a) ( ^type hole ^suit ^rank k) --> ( ^preflop-strength 1) } sp {preflop*elaborate*preflop-strength*2-high-cards-suited (state ^name preflop ^io.input-link.game ) ( ^card ^card ) ( ^type hole ^suit ^rank { << a k q j >> } ) ( ^type hole ^suit ^rank { << a k q j >> <> }) --> ( ^preflop-strength 2) } sp {preflop*elaborate*preflop-strength*high-card-suited (state ^name preflop ^io.input-link.game ) ( ^card ^card ) ( ^type hole ^suit ^rank << a k q j >> ) ( ^type hole ^suit ^rank-num <= 10) --> ( ^preflop-strength 3) } # Extra value because the cards are connected. sp {preflop*elaborate*preflop-strength*10-9-suited (state ^name preflop ^io.input-link.game ) ( ^card ^card ) ( ^type hole ^suit ^rank t) ( ^type hole ^suit ^rank 9) --> ( ^preflop-strength 3) } # -------------------------------------------------------------------- # Unpaired, unsuited # -------------------------------------------------------------------- sp {preflop*elaborate*preflop-strength*ace-king (state ^name preflop ^io.input-link.game ) ( ^card ^card ) ( ^type hole ^suit ^rank a) ( ^type hole ^suit { <> } ^rank k) --> ( ^preflop-strength 2) } sp {preflop*elaborate*preflop-strength*ace-ten (state ^name preflop ^io.input-link.game ) ( ^card ^card ) ( ^type hole ^suit ^rank a) ( ^type hole ^suit { <> } ^rank t) --> ( ^preflop-strength 3) } sp {preflop*elaborate*preflop-strength*2-high-cards (state ^name preflop ^io.input-link.game ) ( ^card ^card ) ( ^type hole ^suit ^rank { << a k q j >> }) ( ^type hole ^suit { <> } ^rank { << a k q j >> <> }) --> ( ^preflop-strength 3) } # -------------------------------------------------------------------- # check-raise proposals # -------------------------------------------------------------------- # -------------------------------------------------------------------- # If we've got the best cards, early position, and no bets yet, # check-raise. # -------------------------------------------------------------------- sp {preflop*propose*check-raise (state ^name preflop ^io ) ( ^input-link ^output-link
    ) ( ^clock ^game ) ( ^num-bets <= 1 ^bet-timing early ^preflop-strength 1) --> ( ^operator +) ( ^name preflop*check-raise ^bet.action check-raise ^score 40) } # -------------------------------------------------------------------- # raise proposals # -------------------------------------------------------------------- # -------------------------------------------------------------------- # If we've got the best cards, bet-raise as much as possible. # -------------------------------------------------------------------- sp {preflop*propose*bet-raise*always (state ^name preflop ^io ) ( ^input-link ^output-link
      ) ( ^clock ^game ) ( ^max-bets ^num-bets < ^preflop-strength 1) --> ( ^operator +) ( ^name preflop*bet-raise*always ^bet.action raise ^score 30) } # -------------------------------------------------------------------- # If we've got excellent cards and excellent position, bet-raise as # much as possible. # -------------------------------------------------------------------- sp {preflop*propose*bet-raise*excellent-both (state ^name preflop ^io ) ( ^input-link ^output-link
        ) ( ^clock ^game ) ( ^max-bets ^num-bets < ^bet-timing << late button >> ^preflop-strength <= 2) --> ( ^operator +) ( ^name preflop*bet-raise*excellent-both ^bet.action raise ^score 30) } # -------------------------------------------------------------------- # If we've got excellent cards, bet-raise once. # -------------------------------------------------------------------- sp {preflop*propose*bet-raise*excellent-cards (state ^name preflop ^io ) ( ^input-link ^output-link
          ) ( ^clock ^game ) ( ^num-bets <= 1 ^preflop-strength <= 2) --> ( ^operator +) ( ^name preflop*bet-raise*excellent-cards ^bet.action raise ^score 30) } # -------------------------------------------------------------------- # If we've got decent cards and excellent position, bet-raise once. # -------------------------------------------------------------------- sp {preflop*propose*raise*excellent-position (state ^name preflop ^io ) ( ^input-link ^output-link
            ) ( ^clock ^game ) ( ^num-bets <= 1 ^bet-timing << late button >> ^preflop-strength <= 3) --> ( ^operator +) ( ^name preflop*raise*excellent-position ^bet.action raise ^score 30) } # -------------------------------------------------------------------- # call proposals # -------------------------------------------------------------------- # -------------------------------------------------------------------- # Decent cards - worth seeing the flop. # -------------------------------------------------------------------- sp {preflop*propose*call (state ^name preflop ^io ) ( ^input-link ^output-link
              ) ( ^clock ^game ) ( ^preflop-strength <= 3) --> ( ^operator +) ( ^name preflop*call ^bet.action call ^score 20) } # -------------------------------------------------------------------- # call proposal - If bluff flag is set and we have good position, call. # The idea is to be less predictable by playing some cards we would # normally toss. # -------------------------------------------------------------------- sp {preflop*propose*call*bluff (state ^name preflop ^io ) ( ^input-link ^output-link
                ) ( ^clock ^game ) ( ^bet-timing << late button >> ^bluff yes) --> (write (crlf) |preflop bluff...|) ( ^operator +) ( ^name preflop*call*bluff ^bet.action call ^score 20) } # -------------------------------------------------------------------- # Weak pairs, strong position, low cost - try to hit trips. # -------------------------------------------------------------------- sp {preflop*propose*call*weak-pairs (state ^name preflop ^io ) ( ^input-link ^output-link
                  ) ( ^clock ^game ) ( ^num-bets 1 ^bet-timing << late button >> ^preflop-strength <= 5) --> ( ^operator +) ( ^name preflop*call*weak-pairs ^bet.action call ^score 20) } # -------------------------------------------------------------------- # Weak pairs, small blind, half a bet - try to hit trips. # -------------------------------------------------------------------- sp {preflop*propose*call*weak-pairs*small-blind (state ^name preflop ^io ) ( ^input-link ^output-link
                    ) ( ^clock ^game ) ( ^bets-to-call 0.5 ^blind small ^preflop-strength <= 5) --> ( ^operator +) ( ^name preflop*call*weak-pairs*small-blind ^bet.action call ^score 20) }