majiang_algorithm
esrrhs/majiang_algorithm · Public GitHub repository
High-performance Mahjong win detection, waiting-hand calculation and AI discard algorithm based on lookup tables, with behavior-identical Java / Go / C++ implementations and a live web demo.
Open the project to try its demo, view the repository, or save it to your collection. Repository and demo actions use RepoShelf’s sign-in flow.

About this project
Author-written excerpt from the project README.
High-performance Mahjong winning-hand detection & AI discard algorithm based on lookup tables, supporting multiple wildcard tiles (jokers). One algorithm, three implementations — Java / Go / C++ — kept behavior-identical by shared cross-language tests.
- Win detection: Millisecond-level check for winning hands, supports any number of wildcard tiles
- Waiting-hand calculation: Quickly lists all tiles that complete the current hand
- AI discard: Score-model-driven auto decision for discarding, ponging, and konging
- Lookup table: Offline pre-computation; runtime does hash lookups only — extremely fast
- Full tile coverage: Characters (Wan), Circles (Tong), Bamboo (Tiao), Wind tiles (East/South/West/North), Arrow tiles (Zhong/Fa/Bai)
Requirements and intended audience
High-performance Mahjong winning-hand detection & AI discard algorithm based on lookup tables, supporting multiple wildcard tiles (jokers). One algorithm, three implementations — Java / Go / C++ — kept behavior-identical by shared cross-language tests.
Not recorded: account, external api key, paid service, self-hosting. Missing information does not mean there are no requirements.
Statements extracted from the author’s documentation · Checked 2026-11-04. Source: https://github.com/esrrhs/majiang_algorithm/blob/master/README.md
Recorded maintenance information
Last recorded source update: 2026-11-03. A published release has not been recorded. These dates do not guarantee ongoing maintenance.
- Technologies
- Go
- Licence
- MIT. Generally permits modification and commercial use, subject to the licence’s notices and conditions.
- Demo check
- A public page loaded on 2026-11-06. This does not test every feature.
Browse related categories
More projects to explore
DeepSite v4
hf:enzostvs/deepsite
Generate any application by Vibe Coding it
Open LLM Leaderboard
hf:open-llm-leaderboard/open_llm_leaderboard
Track, rank and evaluate open LLMs and chatbots
AI Comic Factory
hf:jbilcke-hf/ai-comic-factory
Create your own AI comic with a single prompt
MiroFish
666ghj/MiroFish
A Simple and Universal Swarm Intelligence Engine, Predicting Anything. 简洁通用的群体智能引擎,预测万物