npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@game-claw/texas-holdem

v0.0.1

Published

Texas Hold'em No-Limit poker plugin for game-claw

Readme

English | 中文

@game-claw/texas-holdem

Game Claw 引擎的德州扑克(无限注)插件。

概述

标准无限注德州扑克,支持 2-10 人。实现了完整的 GamePlugin 接口,包括盲注、多轮下注、带废牌的公共牌发放、侧池计算和手牌评估。

规则

基本设置

  • 人数:2-10
  • 牌组:标准 52 张
  • 位置:庄家按钮每手轮转。小盲 = 按钮+1,大盲 = 按钮+2。
  • 底牌:每人 2 张,从小盲开始逐张发放

下注轮次

| 轮次 | 公共牌 | 先行动 | |------|-------|--------| | 翻牌前(Pre-flop) | 无 | UTG(按钮+3)。二人局:按钮先行动。 | | 翻牌(Flop) | 3 张(废 1 发 3) | 小盲 | | 转牌(Turn) | 1 张(废 1 发 1) | 小盲 | | 河牌(River) | 1 张(废 1 发 1) | 小盲 |

操作

| 操作 | 参数 | 规则 | |------|------|------| | fold | — | 弃牌 | | check | — | 仅在无需跟注时可用 | | call | — | 跟注当前下注额 | | raise | { amount } | 加注的总下注额。必须 >= 当前注额 + 上次加注幅度。 | | all-in | { amount } | 全押剩余筹码。即使低于最小加注额也有效,但不会为已行动的玩家重新开放行动权。 |

加注规则

  • 最小加注 = 当前注额 + 上次加注幅度("两倍规则")
  • 示例:大盲=10,玩家加注到 30(加注幅度 20),下一个最小加注 = 30+20 = 50
  • 低于最小加注的全押:允许,但不重新开放已行动玩家的行动权

侧池

当多个玩家以不同金额全押时,引擎自动计算侧池:

  1. 按全押金额升序排列
  2. 每个层级创建一个底池,包含所有有资格玩家的贡献
  3. 每个底池奖励给其中最好的手牌
  4. 零头给庄家按钮顺时针方向最近的赢家

手牌评估

从 7 张牌(2 底牌 + 5 公共牌)中选最佳 5 张:

| 等级 | 牌型 | |------|------| | 9 | 同花顺(含皇家同花顺) | | 8 | 四条 | | 7 | 葫芦 | | 6 | 同花 | | 5 | 顺子 | | 4 | 三条 | | 3 | 两对 | | 2 | 一对 | | 1 | 高牌 |

  • A-2-3-4-5 最小顺子("轮子")有效
  • 平局按踢脚牌降序比较

佣金

每手开局时按玩家人数收取固定费用,结束时打入荷官账户。不从底池中扣除。

使用

import { TexasHoldemPlugin } from '@game-claw/texas-holdem';

const plugin = new TexasHoldemPlugin();
// plugin.meta = { name: 'texas-holdem', minPlayers: 2, maxPlayers: 10 }

文件结构

src/
  plugin.ts       游戏规则、下注、侧池、佣金
  hand-eval.ts    手牌排名与比较