Skip to content

An experimental mahjong evaluation program written in Haskell

License

Notifications You must be signed in to change notification settings

gspindles/mj-score-eval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mj-score-eval

A minor mahjong evaluation program for fun.

Mahjong Scoring Guide

The scoring is based on the Zung Jung scoring system, but includes hands that are not included in the Zung Jung scoring system as well.

The patterns are split into 13 broad category. Within each category [0] are families [0.0] of patterns [0.0.0]. When scoring, you can match patterns across multiple families, but only one pattern match from each family, so pick the highest points pattern match from that family! For example, suppose a hand satisfies Self Drawn : 5 and Three Quartets : 120, then lesser patterns such as One Quartets : 5 and Two Quartet : 20 from the same family in Triplets and Quartets category do not get counted, unless specifically noted otherwise.

Hands may satisfies patterns from multiple families, thus scoring the sum of points from each individual patterns. However, this additive scoring caps at a maximum of 320 points limit. There are quite a few patterns, called Limit Hands, that rewards points at or beyond this 320 points limit. However, they are their own cap - creating a hand that satisfies multiple limit patterns will simply score the highest point value among them. For example, a hand satisfying All Honor Triplets : 320 and Big Four Winds : 400 will simply reward the higher value of 400 point.


1.0 Trivial Patterns

1.1 Chicken Hand : 雞和 : 1

Basic minimal winning hand that doesn't satisfy any patterns other than having bonus tiles.

1.2 All Sequences : 平和 : 5

The hand contains 4 sequences; no triplets / quartets.

Example: c1c2c3b4b5b6b6b7b8k3k4k5

1.3 Concealed Hand : 門前清 : 5

A regular hand which is concealed, without melding any exposed sets before winning. Winning on discard is okay. Concealed quartets are okay.

1.4 Self Drawn : 自摸 : 5

Self draw the winning tile to complete the hand.

1.5 All Simples : 斷么九 : 5

A hand consists entirely of middle number [simple] tiles (2 to 8); no terminals nor honors.

1.6 All Types : 五門齊 : 10

A hand consisting of all 5 tile types.

Example: c3c4c5b4b4b4k7k8k9wnwnwndrdr

1.7 Illegal Call : 詐和 : -40

Declares mahjong accidentally when the hand is not ready.


2.0 Triplets and Quartets

2.1 All Triplets : 對對和 : 30

A hand consisting of 4 set of triplets / quartets; no sequences.

Example: c2c2c2b3b3b3k8k8k8k8wewewe

2.2.1 Two Concealed Triplets : 兩暗刻 : 5

The hand contains two concealed triplets / concealed quartets.

2.2.2 Three Concealed Triplets : 三暗刻 : 30

The hand contains three concealed triplets / concealed quartets.

2.2.3 Four Concealed Triplets : 四暗刻 : 125

The hand contains four concealed triplets / concealed quartets.

Note: Four Concealed Triplets is always Concealed Hand, so it scores at least 125+5=130 points.

2.3.1 One Quartet : 一槓 : 5

The hand contains one quartets. (Irrespective of whether it is exposed or concealed; same below.)

Example: c2c2c2c2

2.3.2 Two Quartets : 兩槓 : 20

The hand contains two quartets.

Example: c2c2c2c2b3b3b3b3

2.3.3 Three Quartets : 三槓 : 120

The hand contains three quartets.

Example: c2c2c2c2b3b3b3b3k8k8k8k8

2.3.4 Four Quartets : 四槓 : 480

The hand contains four quartets.

Example: c2c2c2c2b3b3b3b3k8k8k8k8wewewewe


3.0 Identical Sets

Identical sets are sets in the same suit in the same numbers. Obviously, only sequences can be identical.

3.1.1 Two Identical Sequences : 一般高 : 10

Two sequences in the same suit in the same numbers.

Example: c3c4c5c3c4c5

3.1.2 Two Identical Sequences Twice : 兩般高 : 60

The hand contains two groups of Two Identical Sequences.

Example: c3c4c5c3c4c5c7c8c9c7c8c9

3.1.3 Three Identical Sequences : 一色三同順 : 120

Three sequences in the same suit in the same numbers.

Example: c3c4c5c3c4c5c3c4c5

3.1.4 Four Identical Sequences : 一色四同順 : 480

Four sequences in the same suit in the same numbers.

Example: c3c4c5c3c4c5c3c4c5c3c4c5


4.0 Similar Sets

Similar Sets are sets in the same numbers across 3 different suits.

Note: all 3 suits must be present; 2-suits patterns are not recognized.

4.1 Three Similar Sequences : 三色同順 : 35

Three sequences in the same numbers across three different suits.

Example: c3c4c5b3b4b5k3k4k5

4.2.1 Little Three Similar Triplets : 三色小同刻 : 30

Two triplets / quartets in the same number in two different suits, and the pair of eyes in the same number in the third suit.

Example: c4c4c4k4k4k4b4b4

4.2.2 Three Similar Triplets : 三色同刻 : 120

Three triplets / quartets in the same number across three different suits.

Example: c4c4c4k4k4k4b4b4b4


5.0 Consecutive Sets

Consecutive sets are sets in the same suit in consecutive numbers. The patterns here require three or more such sets.

5.1.1 Three Consecutive Sequences : 三連順 : 30

Three sequences in consecutive number in the same suit with either

increment by 1 step: (n)(n+1)(n+2)  (n+1)(n+2)(n+3)  (n+2)(n+3)(n+4)
increment by 2 step: (n)(n+1)(n+2)  (n+2)(n+3)(n+4)  (n+4)(n+5)(n+6)

Example (1 step): k1k2k3k2k3k4k3k4k5

Example (2 step): k1k2k3k3k4k5k5k6k7

5.1.2 Nine-Tile Straight : 一氣通貫 : 40

A 123 sequence, a 456 sequence, and a 789 sequence, all in the same suit.

Note: the hand must contain exactly the three sequences listed above.

Example: k1k2k3k4k5k6k7k8k9

5.1.3 Three Consecutive Sequences Twice : 雙三連順 : 50

Two of Three Consecutive Sequences in the same suit that either

diverges at the start: (n)(n+1)(n+2)  (n+1)(n+2)(n+3)  (n+2)(n+3)(n+4)  (n+4)(n+5)(n+6)
converges at the end : (n)(n+1)(n+2)  (n+2)(n+3)(n+4)  (n+3)(n+4)(n+5)  (n+4)(n+5)(n+6)

Note: this hand is always All Sequences, so it scores at least 50+5=55 points.

Example: k1k2k3k2k3k4k3k4k5k5k6k7sequences #1,2,3 and #1,3,4 makes 2 Three Consecutive Sequences

Example: k1k2k3k3k4k5k4k5k6k5k6k7sequences #1,2,4 and #2,3,4 makes 2 Three Consecutive Sequences

5.1.4 Four Consecutive Sequences : 四連順 : 100

Four sequences in consecutive number in the same suit with either

Note: this hand is always All Sequences, so it scores at least 100+5=105 points.

increment by 1 step: (n)(n+1)(n+2)  (n+1)(n+2)(n+3)  (n+2)(n+3)(n+4)  (n+3)(n+4)(n+5)
increment by 2 step: (n)(n+1)(n+2)  (n+2)(n+3)(n+4)  (n+4)(n+5)(n+6)  (n+6)(n+7)(n+8)

Example: k1k2k3k2k3k4k3k4k5k4k5k6

Example: k1k2k3k3k4k5k5k6k7k7k8k9

5.2.1 Three Consecutive Triplets : 三連刻 : 100

Three triplets / quartets in consecutive numbers in the same suit.

Example: k4k4k4k5k5k5k6k6k6

5.2.2 Four Consecutive Triplets : 四連刻 : 200

Four triplets / quartets in consecutive numbers in the same suit.

Note: this hand is always All Triplets, so it scores at least 200+30=230 points.

Example: k4k4k4k5k5k5k6k6k6k7k7k7

5.2.3 Three Mothers : 三娘教子 : 320

Hand consist of Three Consecutive Triplets with a sequence of the same three remaining tiles.

Example: k5k5k5k6k6k6k7k7k7k5k6k7


6.0 Suit Patterns

6.1.1 Mixed One-Suit : 混一色 : 40

The hand consists entirely of number tiles in one suit, plus honor tiles.

Example: c2c3c4c7c7c7wswswsdwdwdwc8c8

Example: b2b2b4b4b7b7b8b8wswswnwndgdg

6.1.2 Pure One-Suit : 清一色 : 80

The hand consists entirely of number tiles in one suit.

Example: k2k3k4k3k4k5k6k6k6k7k8k9k8k8

Example: k1k1k2k2k4k4k5k5k7k7k8k8k9k9

6.2 Nine Gates : 九蓮寶燈 : 480

A 9-way call hand, with 1112345678999 in one suit in your hand, and winning on any one tile in the same suit.

Note: pure version only, impure version doesn't count. That is, the pattern must be completed, you have to be 9-way calling.

Example: 1112245678999 on hand, and self draws a 3, then the player must discard the extra 2 in order to to qualify as 9-way calling. Otherwise, it's only Pure One-Suit.

Pattern: c1c1c1c2c3c4c5c6c7c8c9c9c9

with 1 => 111 123 456 789 99
with 2 => 111 22 345 678 999
with 3 => 11 123 345 678 999
with 4 => 111 234 456 789 99
with 5 => 111 234 55 678 999
with 6 => 11 123 456 678 999
with 7 => 111 234 567 789 99
with 8 => 111 234 567 88 999
with 9 => 11 123 456 789 999

7.0 Terminal Tiles

Terminals are the 1 and 9 numbered suit tiles. The greater patterns only consider triplets of terminal tiles, while the lesser patterns also involve 123 and 789 sequences.

7.1.1 Two-Tailed Terminal Sequences : 老少順 : 5 per set

A sequece of 123 and 789 in the same suit.

Example: b1b2b3b7b8b9

7.1.2 Two-Tailed Terminal Triplets : 老少刻 : 10 per set

A triplet / quartet of 1s and 9s in the same suit.

Example: k1k1k1k9k9k9

7.1.3 Two-Tailed Terminals : 老少么九 : 120

The hand consists of the pattern 111 123 789 999 in a suit.

Note: this always includes Two-Tailed Terminal Sequences and Two-Tailed Terminal Triplets, so it scores is 100 + 5 + 15 = 120

Example: c1c1c1c1c2c3c7c8c9c9c9c9

7.2.1 Mixed Lesser Terminals : 混全帶么九 : 40

Every of the 4 sets in the hand, as well as the pair of eyes, includes a terminal tile or an honor tile.

Example: b1b1b1k1k2k3c7c8c9drdrdrk9k9

7.2.2 Pure Lesser Terminals : 純全帶么九 : 50

Every of the 4 sets in the hand, as well as the pair of eyes, includes a terminal number tile.

Example: b1b2b3k1k1k1k7k8k9c9c9c9b1b1

7.2.3 Mixed Greater Terminals : 混么九 : 100

An All Triplets or Seven Pairs hand which consists entirely of terminal and honor tiles.

Note: not applicable to a Thirteen Orphans hand.

Example: b9b9b9k1k1k1wwwwwwdgdgdgc1c1

Example: c1c1b1b1k1k1k9k9wewewnwndwdw

7.2.4 Pure Suit Terminals : 一色全帶么九 : 320

Combination of Pure One-Suit and Pure Lesser Terminals.

Note: with Two Identical Sequences Twice - 11 123 123 789 789 or 123 123 789 798 99
or with Three Identical Sequences - 11 123 789 789 789 or 123 123 123 789 99
or using up all 8 terminal tiles of one suit - 11 123 123 789 999 or 111 123 789 789 99
count Four Identical Sequences otherwise - 11 789 789 789 789 or 123 123 123 123 99

Example: c1c2c3c1c2c3c7c8c9c7c8c9c1c1

Example: c1c2c3c1c2c3c1c2c3c7c8c9c9c9

Example: b1b1b1b2b3b1b2b3b7b8b9b9b9b9

Example: k1k1k1k1k2k3k7k8k9k7k8k9k9k9

7.2.5 Pure Greater Terminals : 清么九 : 400

The hand consists entirely of terminal tiles.

Example: c1c1c1c9c9c9b1b1b1b9b9b9k9k9

Example: c1c1c9c9! b1b1! b9b9! k1k1k9k9b1b1


8.0 Honor Tiles

Honor tiles are the wind and dragon tiles.

8.1.1 Wind Triplet : 風刻 : 5

A triplets / quartets of a wind tile.

Note: Seat wind and Prevailing Wind are not recognized.

8.1.2 Little Three Winds : 小三風 : 30 -> 40

Two triplets / quartets of Winds, plus a pair of Winds as the pair of eyes.

Note: this hand always includes 2 Wind Triplets, so it scores at least 30+5+5=40 points.

Example: wwwwwwwnwnwnwewe

8.1.3 Big Three Winds : 大三風 : 120 -> 135

Three triplets / quartets of Winds.

Note: this hand always includes 3 Wind Triplets, so it scores at least 120+5+5+5=135 points.

Example: wewewewswswswnwnwn

8.1.4 Little Four Winds : 小四喜 : 320

Three triplets / quartets of Winds, plus a pair of Winds as the pair of eyes.

Example: wewewewwwwwwwnwnwnwsws

8.1.5 Big Four Winds : 大四喜 : 400

Four triplets / quartets of Winds.

Pattern: wewewewswswswwwwwwwnwnwn

8.2.1 Dragon Triplet : 箭刻 : 10 per set

A triplets / quartets of a dragon tile.

8.2.2 Little Three Dragons : 小三元 : 40 -> 60

Two triplets / quartets of Dragons, plus a pair of Dragons as the pair of eyes.

Note: this hand always includes two Dragon Triplets, so it scores at least 40+10+10=60 points.

Example: dwdwdwdrdrdrdgdg

8.2.3 Big Three Dragons : 大三元 : 130 -> 160

Three triplets / quartets of Dragons.

Note: this hand always includes three Dragon Triplets, so it scores at least 130+10+10+10=160 points.

Pattern: dwdwdwdgdgdgdrdrdr

8.3.1 All Honor Triplets : 字一色 : 320

The hand consists entirely of honor tiles.

Example: wewewewnwnwndrdrdrdgdgdgwsws

8.3.2 All Honor Pairs : 大七星 : 480

The hand consists of pairs of all seven honor tiles.

Pattern: wewewswswwwwwnwndrdrdgdgdwdw


9.0 Color Hands

9.1 All Green : 緑一色 : 400

The hand consists of tiles from the set 2, 3, 4, 6, 8 bamboo and the green dragon tile.

Green Tiles: b2 b3 b4 b6 b8 dg

Example: b2b3b4b3b3b3b6b6b6dgdgdgb8b8

9.2 All Red : 紅孔雀 : 480

The hand consists of tiles from the set 1, 3, 5, 7 bamboo and the red dragon tile.

Red Tiles: b1 b5 b7 b9 dr

Example: b1b1b1b5b5b5b7b7b7b9b9b9drdr


10.0 Irregular Hands

Thirteen Orphans hand does not count for Concealed Hand, All Types, nor Mixed Greater Terminals.

10.1 Thirteen Orphans : 十三么九 : 160 / 320 (十三面, 13 waits)

Among the 13 types of terminals and honors, the hand contains one pair of one type, and one tile each of the other 12 types.

Note: the hand scores 320 instead if it is a 13 wait situation where the pair of eyes is not initially complete.

Example: c1b1b9k1k9wewswswwwndrdgdw=> wait for c9 to complete pattern

Example: c1c9b1b9k1k9wewswwwndrdgdw=> 13 possible waits

Seven pairs hand are hands that consists of seven pairs. A Seven Pairs hand cannot count those patterns which specifically require sequences, triplets, or quartets, but it can count for other patterns without such requirements.

Note: Four identical tiles can count as two pairs as long as quartet is not declared.

10.2.1 Seven Pairs : 七對子 : 30

The hand consists of seven pairs.

Note: Seven Pairs is always Concealed Hand, so it scores at least 30+5=35 points.

Example: k2k2k6k6c1c1c7c7dwdwwwwwwnwn

10.2.2 Seven Consecutive Pairs : 連七對 : 320

The hand consists of seven consecutive pairs, from 1-7, 2-8, or 3-9.

Example: c1c1c2c2c3c3c4c4c5c5c6c6c7c7

Pattern: b2b2b3b3b4b4b5b5b6b6b7b7b8b8

Pattern: k3k3k4k4k5k5k6k6k7k7k8k8k9k9


11.0 Incidental bonuses

Lucky bonuses for winning on rare opportunities.

11.1.1 Final Draw : 海底撈月 : 10

Self Drawn win on the seabed tile (the last tile in the wall, excluding the king's tiles).

11.1.2 Final Discard : 河底撈魚 : 10

Winning on a discarded riverbed tile (the last discard by the player who has drawn the seabed tile).

11.2.1 Win on Quartet : 嶺上開花 : 10

Self Drawn win on a supplement tile after declaring a quartet.

Note: if the supplement tile is also the seabed tile, both patterns can be counted.

11.2.2 Win on Bonus Tile : 花上自摸 : 10

Self Drawn win on a supplement tile after drawing a bonus tile.

Note: if the supplement tile is also the seabed tile, both patterns can be counted.

11.3 Robbing a Quartet : 搶槓 : 10

Winning by robbing a quartet promotion. As for concealed quartet, only Thirteen Orphans hand can rob a concealed quartet.

11.4.1 Blessing of Heaven : 天和 : 155

East winning with his initial 14-tile hand.

Note: does not count if East has made a concealed quartet.

11.4.2 Blessing of Earth : 地和 : 155

A non-East player calling with his initial 13-tile hand, and winning on East's very first discard.

Note: does not count if East has made a concealed quartet.


12.0 Bonus Tiles

Flowers tiles only provide bonus points, they do NOT contribute to having the minimum requirements to win.

12.1 Bonus Flower / Bonus Season : 花季牌 : 2 per tile

Each flower or season bonus tile is worth 2 points unless completing the set.

12.1.1 Four Flowers : 齊四花 : 20

A complete set of all 4 Flower tiles.

Pattern: f1f2f3f4

12.1.2 Four Seasons : 齊四季 : 20

A complete set of all 4 Season tiles.

Note: 15 -> 20 for season quartet.

Pattern: s1s2s3s4

12.1.3 All Bonus Tiles : 八仙過海 : 40

A complete set of all 8 bonus tiles.

Pattern: f1f2f3f4s1s2s3s4

About

An experimental mahjong evaluation program written in Haskell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published