Skip to content

Instantly share code, notes, and snippets.

@taksuyu
Last active August 29, 2015 14:12
Show Gist options
  • Save taksuyu/3bcc1575b1561d1154a4 to your computer and use it in GitHub Desktop.
Save taksuyu/3bcc1575b1561d1154a4 to your computer and use it in GitHub Desktop.
Rules around calculating Shanten for Japanese Riichi Mahjong

Shanten

Taking a hand (14 mahjong tiles) and figuring out the number of tiles you have to replace to have a winning hand.

This doesn't take account for the value, but just that a hand is in a winning state.

Tenpai is determined if a hand has a Shanten of 1.

Chiitoitsu (7 pairs)

When a hand has 7 unique* duplicates, it is a winning hand. This is the worst possible Shanten you can shoot for in Mahjong.

* Some rules allow a Quad (4 of a kind) to count as two pairs.

Chiitoitsu rules

  1. Can't have more than 7 pairs.
  2. After removing pairs from your hand count, you can take half of the remainder as your Shanten.

Melds

  • Set (3 of a kind)
  • Quad (4 of a kind)
  • Run (A sequence of 3 tiles that are in the same suit)

Melds rules

  1. Can't have more than 4 melds.
  2. Removing a meld from your hand, only counts as 3 tiles towards Shanten.

Waits

A wait is an incomplete meld, that needs at least 1 tile to become a meld.

A pair wait is when you have a single tile that just needs to be pair to progress your hand (Cases of where you have no pairs, or are going for Chiitoitsu).

Wait rules

  1. If you have 12 pair waits and a pair that are all Ends (Terminals and Honors) then you have a winning hand (Thirteen Orphans).
  2. Every wait other than a pair wait will remove 2 tiles from your hand when calculating Shanten, up to 4 minus every meld.
  3. You may only remove only a single pair wait when you are calculating Shanten.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment