pkg:clod/com.clodhub/poker-strategy 0.12.0 Decisions for computer poker players: win chance by simulation, pot odds, position, a style and a memory of how each opponent has played. Difficulty 1 to 3 and aggression. Given what a computer player can see at its turn (its cards, the board, the pot, what the rules allow, who is still in and how they have acted) returns fold, check, call or a bet to a total. The decision weighs the simulated chance of winning against pot odds, the share of the stack a call would cost, position, the street, a little noise and how aggressive each opponent has been so far. Before the flop it adds raise, call and all-in thresholds for short stacks. It does not choose names, schedule when a bot acts or apply the action: those belong to computer-players and the engine. Examples A table of four people and two computer players: each computer player is given a style by name, decides in its turn and its action is applied. A teaching table sets difficulty 1 for gentle opponents. A tournament raises difficulty to 3 for the final table. Package URL: pkg:clod/com.clodhub/poker-strategy@0.12.0 Class: Poker strategy (pkg:clod/com.clodhub/poker-strategy-class@1.1.0): Decisions for a computer poker player from its cards and the table. Any component of this class can fill a recipe slot that asks for it. Category games/cards/poker; https://clodhub.com/classes/poker-strategy-class.txt; 0 other components of this class: https://clodhub.com/components.txt?class=pkg%3Aclod%2Fcom.clodhub%2Fpoker-strategy-class Provides (1) - player-strategy (com.clodhub/player-strategy 1.0.0): Decisions for computer poker players: win chance by simulation, pot odds, position, a style (how tight, how aggressive, how often it bluffs) and a memory of how each opponent has played. Pure: the table state arrives as a DecisionInput, randomness as a function, the result is an action. TypeScript, `implementation/server/index.ts` (strategy.ts, types.ts). Build with createStrategy({odds}, settings); methods named `Strategy.` are members of the object it returns. The computer-players form is newMemory, choose and observe; decide is choose without the player id. components that use it: https://clodhub.com/components.txt?requires=com.clodhub%2Fplayer-strategy Requires (2) - hand-ranking (com.clodhub/hand-ranking 1.0.0): The best five-card poker hand out of five to seven cards. A higher score wins; equal scores tie. TypeScript, `implementation/server/index.ts` (ranking.ts, codes.ts). Build a ranking with createHandRanking(codes) over card-deck's cardCodes, or use the ready-made handRanking; methods named `HandRanking.` are members of that object. components that provide it: https://clodhub.com/components.txt?provides=com.clodhub%2Fhand-ranking - poker-odds (com.clodhub/poker-odds 1.0.0): What a player's hand can still become, and the chance of holding the best hand. `rows`: the hand already made with the known cards first at 100%, then every way of making a better hand with the exact chance that its needed cards turn up by the river; which ways exist is read from every board that can follow from the flop on, and from a fixed sample of boards before it. `winChance`: the chance of the best hand against opponents, by sampling. TypeScript, `implementation/server/index.ts` (odds.ts, types.ts). Build with createOdds(ranking, settings); methods named `Odds.` are members of the object it returns. components that provide it: https://clodhub.com/components.txt?provides=com.clodhub%2Fpoker-odds Settings (2) The installer collects two optional settings. `difficulty` is 1, 2 or 3 (default 2): 1 plays quickly and loosely, makes more mistakes and ignores how opponents play; 2 is the standard computer player; 3 thinks longer, makes fewer mistakes and plays steadier. `aggression` is a number from 0 to 100 (default 50): how readily the computer bets and raises rather than checks and calls; 0 is very passive, 100 bets whenever it can. - difficulty: integer; optional, default 2 - aggression: integer; optional, default 50 Depends on components: none How to use in a recipe A recipe uses it through a slot of class Poker strategy (pkg:clod/com.clodhub/poker-strategy-class 1.1.0), naming pkg:clod/com.clodhub/poker-strategy as the slot's preferred component or substituting it for another component of the class. The recipe connects what it provides (player-strategy) to the slots that use it. It fills what the component needs (hand-ranking and poker-odds) from slots whose components provide them. The recipe sets difficulty and aggression; any it leaves out takes its default. - as a slot in recipe.json components: {"id":"poker-strategy","class":{"name":"pkg:clod/com.clodhub/poker-strategy-class","version":"1.1.0","digest":"4c8235295b2477ecb7fcb2e6699e0d4d23a4ca6811a37f69c9cd6fa997f35d79"},"preferred":{"name":"pkg:clod/com.clodhub/poker-strategy","version":"0.12.0"}} - in place of another component of the class: clod fetch poker-strategy@0.12.0 --store store --from https://clodhub.com, then clod design RECIPE@VERSION --store store --answers answers.json --substitute SLOT=poker-strategy@0.12.0 --out definition.json Used by recipes: pkg:clod/com.clodhub/ourpoker-recipe 0.13.0 (slot poker-strategy) For developers: how an application uses it Create it with `createStrategy({ odds }, { difficulty, aggression })`, where `odds` is the poker-odds interface (which itself needs hand-ranking). computer-players calls `decide` when it is a bot's turn and applies the returned action through the game rules; it calls `observe` after every action and `learnHand` after each deal, keeping the memory object between calls. The caller gives each bot an optional style (tight, aggr, bluff from 0 to 1); without one the style is neutral and aggression comes from the setting. computer-players uses the three-operation form: `newMemory()` for a fresh memory, `choose(observation, playerId, rng, memory)` (the observation is the `DecisionInput` the game rules give for that player; null or anything else is no decision) and `observe(memory, observation, playerId, move)` after every move (counts the mover and returns the memory). `decide(input, rng, memory)` is `choose` without the player id. Accounts and services No deployed service, account or key. CPU only: a decision samples 200 to 900 boards (difficulty 2: 200 before the flop, 300 after) in a few milliseconds. How it is checked `node --test tests/server.test.ts` checks turn handling, setting validation, bet sizing, clamping to the legal range and rounding to the small blind, calling and folding against pot odds, short-stack pushing, the effect of aggression and style, the sampling and range reading of each difficulty, memory-based reads, observe and learnHand counts, and real-odds decisions. The extraction at difficulty 2 was compared with the recipe's botAction on 400 random spots (all streets, short and deep stacks, with and without memory and styles): identical actions with the same random sequence. It also checks `newMemory`, `choose` (the same move as `decide`, null for nothing to decide, memory unchanged, bets inside the legal range with real odds) and `observe` (counts per mover, ignored moves, plain-JSON memory). - `node --test tests/server.test.ts` (web, required-local; tools: node 26.5) Updates Removing the component removes the files; the memory object is owned by the caller. Tags: cards, games, poker, strategy Targets: client none; server none Publisher: George McIntyre (george-mcintyre) Guardians: Level N Ltd (guardian key 08775f20) Source: clodhub/poker-strategy release v0.12.0; digest sha256:7df25defee25eeba9981d176e7854f427e001d79680bdc4b3a75e454ba52aee8 Release: features Line 0.12: no security releases Quality: Integration-tested, certified Known vulnerabilities: none known (checked 2026-11-26 at OSV); https://clodhub.com/api/components/poker-strategy/0.12.0/vulnerabilities Downloads: 1 in 30 days; 1 of this version Classes: https://clodhub.com/classes.txt; this component as JSON: https://clodhub.com/api/components/poker-strategy/0.12.0 Bundle download: GET https://clodhub.com/api/components/poker-strategy/0.12.0/bundle returns a link valid for one hour Implements: pkg:clod/com.clodhub/poker-strategy-class@1.1.0 4c8235295b2477ecb7fcb2e6699e0d4d23a4ca6811a37f69c9cd6fa997f35d79 com.clodhub/player-strategy 1.0.0 entry modules: server server/index.ts shared behaviour suites: shared Platforms: server Toolchains: node >=26.5.0 <27.0.0 Frameworks: none Styles: scope none; 0 namespaces; 0 conflicts Licence: Apache-2.0; 0 upstream sources, 0 exact dependencies, 29 files (listed on the details page) Suitable for jobs: poker-strategy profile any: cost none; load none; regions any; compliance none Notes: Pure library, CPU only. No hosted service, account or provider limit applies; a decision is milliseconds of simulation. Data migration: this component keeps no data Maintainers: Level N Ltd; https://github.com/clodhub/poker-strategy/issues; updates https://github.com/clodhub/poker-strategy/releases (manual) What you download poker-strategy-0.12.0.tar, from release v0.12.0 of clodhub/poker-strategy: 29 files - Documents and manifests (8): CONTRACT.md, INSTRUCTIONS.md, LICENCE, NOTICE, PROVENANCE.md, SOURCE.md, ... - Source code (3): server/ (3) - Tests (6): server.test.ts, support/ (5) - Interface documents (3): player-strategy.json, required-hand-ranking.json, required-poker-odds.json - Class files: the class's interfaces and shared checks (3): poker-strategy-class/ (3) - Examples (1): consumer.ts - Diagrams (5): definition.json, examples/ (1), output/ (3) Installing copies 3 of them into the application under components/poker-strategy/: server 3 Not included: the components that provide what it requires (com.clodhub/hand-ranking, com.clodhub/poker-odds), each a separate download; the values of its settings, which the recipe writes; any secret The archive is a release file on the publisher's public GitHub repository; ClodHub keeps this page and a pointer to the release, not the code. clod checks the archive's sha256 fingerprint before anything is copied, and installing runs none of the package's code. Versions - 0.12.0 features (2026-11-26T11:29:21.567Z) sha256:7df25defee25eeba9981d176e7854f427e001d79680bdc4b3a75e454ba52aee8 Links Details (package foundations, upstream sources, exact dependencies, styles, class inventories, files): https://clodhub.com/components/poker-strategy/details.txt?version=0.12.0 Page: https://clodhub.com/components/poker-strategy; JSON: https://clodhub.com/api/components/poker-strategy/0.12.0; connections diagram: https://clodhub.com/api/components/poker-strategy/0.12.0/connections.svg Copyright Level N Ltd 2026