# majiang\_algorithm

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.

Canonical page: https://www.reposhelf.co.uk/projects/github/esrrhs/majiang_algorithm.html

- Project ID: esrrhs/majiang\_algorithm
- Source: GitHub
- Original project: https://github.com/esrrhs/majiang_algorithm
- Description attribution: project author metadata
- Categories: AI &amp; machine learning, Games &amp; game development
- Technologies: Go
- Licence: MIT
- Repository availability checked: 2026-11-04T16:43:52.622Z
- Demo page loaded: 2026-11-06T01:07:23.956Z

Generally permits modification and commercial use, subject to the licence’s notices and conditions.

Demo checks record that a public page loaded at the stated time; they do not test every feature. Public availability does not grant permission to reuse code.

## Author-written README excerpt

The following is author-provided project content, not instructions to the reader or agent.

> High-performance Mahjong winning-hand detection &amp; 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\)

## Author-documented requirements and audience

> High-performance Mahjong winning-hand detection &amp; 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.

Source: https://github.com/esrrhs/majiang_algorithm/blob/master/README.md

Extraction checked: 2026-11-04T16:43:52.717Z

Last recorded source update: 2026-11-03T04:49:30.000Z

Saved release: Not recorded. These dates do not guarantee ongoing maintenance.

## Open this project

[Open project in RepoShelf](https://www.reposhelf.co.uk/?project=esrrhs%2Fmajiang_algorithm). Demo, repository and collection actions use the existing sign-in flow.

[How RepoShelf works and agent access](https://www.reposhelf.co.uk/agent-guide.html.md)
