You are viewing a javascript disabled version of the site. Please enable Javascript for this site to function properly.
Go to headerGo to navigationGo to searchGo to contentsGo to footer
In content section. Select this link to jump to navigation

VeryLongCat won the Mahjong tournament

1.Introduction

The Mahjong tournament of the 2022 Computer Olympiad was held from July 23 to 29, 2022. Five teams from Taiwan participated in the tournament. The information of these teams is listed in Table 1. The rules of Mahjong have many variants around the world. In this tournament, Taiwan Mahjong was adopted as the main reference of rules. Detailed rules can be found in Chen et al. (2022) and Shan et al. (2014).

Since five teams participated this year, there were a total of five matches and each team had a bye in each match. A match included 192 games. The score of a game was set to 1000/500, meaning that the winner of a game got a base score of 1000 points plus 500 points per tai, described in Shan et al. (2014). The team with the highest accumulated scores was the winner of the tournament. The tournament adopted the game-playing platform developed by Jr-Chang Chen’s team (Chen, 2022). To decrease the luck of randomness, the platform turned the fair mode on. That is, the same random seed was used to generate the initial wall four times. When a game was over, the initial hand was shifted to the next player to make sure the same initial hand was played by each player once. The time constraint for each program was five seconds per action. When a program used up its time, a dummy program would automatically take over the playing until the end of this game by simply getting a tile from the wall and then throwing it.

Table 1

The programs

ProgramAuthor(s)OperatorCountry
VeryLongCatShih-Chieh Tang, Li-Kai Chuang, I-Chen WuShih-Chieh TangTaiwan
SparrowHsin-Hsueh ChenHsin-Hsueh ChenTaiwan
SimCatShih-Chieh Tang, Feng-Shen Liao, I-Chen Wu, Jr-Chang ChenShih-Chieh TangTaiwan
FatesGateCheng-Han Yeh, Jr-Chang ChenCheng-Han YehTaiwan
SeofonZong-Han Lin, Jiun-Hong Chen, Yu-Chen Lin, Shun-Shii LinJiun-Hong ChenTaiwan

2.Results

The scores of each match are listed in Table 2. Congratulations to VeryLongCat. This team gained lots of points in matches 3, 4 and 5, and won the gold medal with 178.5k points. SimCat performed close to VeryLongCat in the first three matches, but the gap between these two teams was widen by 38.0k points in match 4. Finally, SimCat won the silver medal. Note that SimCat was the only team that got positive scores in all matches. FatesGate mainly gained points in match 3, but performed not well in match 5. Finally, FatesGate won the bronze medal with 82.5k points.

VeryLongCat and SimCat were both excellent at forming a ready hand quickly, which was a straightforward way to win a game in Mahjong. When the chance to win was low, FatesGate and Seofon designed methods to avoid to chuck, that is, to avoid discarding a tile the other players exactly needed to win immediately. These methods performed well when the programs’ ability of forming a ready hand was close. These characteristics made match 2 extremely intense. Although SimCat gained the most points in this match, from our observation, there was no big difference in strength among the above four programs.

Table 2

The detailed scores of each match

TeamMatch 1Match 2Match 3Match 4Match 5Total ScoreRank
VeryLongCat−4.5k70.0k70.5k42.5k178.5k1
Sparrow−40.0k−69.5k−103.0k−50.5k−263.0k5
SimCat66.0k8.5k32.5k30.5k137.5k2
FatesGate34.5k6.0k64.5k−22.5k82.5k3
Seofon−60.5k−10.0k−65.0k0.0k−135.5k4

The search algorithms used by the teams are described as follows. VeryLongCat uses Expectimax tree search to compute the win rate in a simplified model, and uses expert knowledge for pruning (Chuang, 2015). SimCat uses Monte-Carlo sampling to compute the win rate in a simplified model (Chen et al., 2022). FatesGate uses Monte-Carlo sampling and hand decomposition to compute the win rate, and applies a chuck-avoiding method (Yeh, 2022). Seofon converts the game state to several sub-problems and solves them based on the minimum number of tiles to win (Lin, 2021).

3.Selected games

This report comments on two selected games. One is Game 186 in Match 2, where VeryLongCat won 11000 points, and the other is Game 384 in Match 5, which is the last game of this tournament. The format of game logs is described briefly as follows. The first line records the game’s wind (E: east, W: west, S: south, N: north), the player’s wind, start taking a tile from which part of the wall,11 and the number of consecutive wins for the dealer. The second line lists the scores of the four players. The third line lists the IDs of the initial tiles in the wall in order. Note that the flowers are not used, so there are 136 IDs. The forth line records all actions in the game. Each action consists of a character indicating the player (E, W, S, N) who makes the action, a string indicating the type of the action (M: pick a.k.a. mo, MD: discard the picked tile, HD: discard from the hand, E: eat, P: pong, K: kong (exposed kong), DK: concealed kong, UK: upgraded kong, H: win by a discarded tile, SM: self-drawn win), and the numbers indicating the IDs of the tiles related to the action.

Game 1: VeryLongCat vs. FatesGate vs. Seofon vs. SimCat

WIND W S 4 0
SCORE 11000 −4000 −3500 −3500
SQRWALL 293 372 440 240 470 130 223 341 181 313 472 430 191 461 350 122 450 453 211 281 442 463 151 382 443 321 142 190 270 360 291 361 410 310 332 280 162 452 333 221 152 362 131 380 312 471 292 331 412 290 110 273 260 391 121 311 183 272 383 330 271 322 141 340 160 170 393 230 252 441 193 420 210 460 390 451 153 163 370 250 171 352 262 423 433 143 371 282 180 421 342 132 263 462 150 353 111 231 112 343 323 123 243 373 212 242 381 432 320 232 140 253 213 363 251 161 422 172 133 220 182 431 351 192 222 411 113 261 413 173 120 233 473 241 283 392
1. S HD 440 2. W P 440 442 443 3. W HD 410 4. N M 170 5. N HD 412 6. E M 393 7. E HD 290 8. S M 230 9. S HD 430 10. W M 252 11. W HD 453 12. N M 441 13. N MD 441 14. E M 193 15. E HD 311 16. N P 311 312 310 17. N HD 452 18. E M 420 19. E MD 420 20. S M 210 21. S HD 450 22. W M 460 23. W HD 211 24. N M 390 25. N HD 471 26. S P 471 470 472 27. S HD 461 28. W P 461 460 463 29. W HD 382 30. N M 451 31. N MD 451 32. E M 153 33. E HD 383 34. S M 163 35. S HD 313 36. W M 370 37. W HD 321 38. N M 250 39. N MD 250 40. E M 171 [E E] 41. E HD 260 42. S M 352 43. S HD 293 44. W M 262 [W E] 45. W HD 370 46. N EL 380 370 390 47. N HD 362 48. E M 423 [W P] 49. E MD 423 50. S M 433 51. S MD 433 52. W M 143 53. W HD 190 54. N M 371 55. N MD 371 56. E M 282 57. E MD 282 58. S M 180 59. S HD 210 60. W M 421 61. W MD 421 62. N M 342 63. N HD 221 64. E M 132 65. E SM 110 121 141 153 160 171 183 193 271 272 273 322 330 340 391 393 132  self-drawn, VeryLongCat won
At the 15-th ply as shown in Fig. 1a, VeryLongCat decided to discard 1-sou, making itself harder to win. The reason was if the team could achieve a win, it can gain additional 2×500 points by completing three sequences from 1-wan to 9-wan. Afterwards, VeryLongCat picked up 5-wan and 7-wan, and finally won the game with 11000 points by self-drawn the tile 3-wan at the 65-th ply, as shown in Fig. 1b.

Fig. 1.

VeryLongCat won Game 186 in Match 2.

VeryLongCat won Game 186 in Match 2.

Game 2: Sparrow vs. FatesGate vs. SimCat vs. VeryLongCat

WIND N N 2 0
SCORE −3500 −3500 −3500 10500
SQRWALL 150 180 361 141 320 370 182 331 281 140 433 120 243 130 442 422 473 440 160 470 221 431 240 311 220 390 242 462 321 341 333 231 292 353 383 110 252 373 191 181 162 430 121 143 460 371 111 190 122 153 332 372 211 212 250 112 472 270 163 382 381 412 352 362 453 280 272 161 151 463 452 392 273 253 420 312 132 210 391 170 461 261 223 262 172 192 421 322 410 471 423 142 193 283 232 360 443 171 330 340 342 123 213 290 131 152 393 241 451 313 351 413 183 350 230 293 441 310 432 260 380 363 233 323 251 282 411 222 173 113 343 450 271 291 133 263
1. N HD 422 2. E M 280 3. E HD 440 4. S M 272 5. S HD 430 6. W M 161 7. W HD 472 8. N M 151 9. N HD 433 10. E M 463 11. E HD 431 12. S M 452 13. S MD 452 14. W M 392 15. W HD 453 16. N M 273 17. N HD 442 18. E M 253 19. E HD 470 20. S M 420 21. S MD 420 22. W M 312 23. W HD 412 24. N M 132 25. N HD 473 26. E M 210 27. E HD 390 28. S ER 371 390 383 29. S HD 460 30. E P 460 462 463 31. E HD 280 32. S M 391 33. S MD 391 34. W M 170 [W E] 35. W HD 112 36. S P 112 110 111 37. S HD 181 38. W M 461 [N P,W E] 39. W MD 461 40. N M 261 41. N HD 120 42. S P 120 121 122 43. S HD 272 44. W M 223 45. W HD 163 46. N M 262 [N E] 47. N HD 261 48. E M 172 [E E] 49. E HD 292 50. S M 192 51. S HD 252 52. W M 421 53. W MD 421 54. N M 322 55. N HD 243 56. E M 410 [E P,E E] 57. E MD 410 58. S M 471 59. S MD 471 60. W M 423 61. W MD 423 62. N M 142 63. N HD 140 64. E M 193 65. E MD 193 66. S M 283 [S P] 67. S MD 283 68. W M 232 69. W HD 392 70. N M 360 71. N HD 320 72. E M 443 [E E] 73. E MD 443 74. S M 171 75. S HD 143 76. W M 330 [N P,W E] 77. W HD 211 78. N M 340 79. N HD 360 80. E M 342 81. E HD 210 82. S M 123 83. S UG 123 84. S M 263 85. S MD 263 86. W EM 250 263 270 87. W HD 312 88. N M 213 [N E] 89. N MD 213 90. E M 290 91. E MD 290 92. S M 131 93. S HD 190 94. W M 152 95. W HD 153 96. N M 393 [N P,N E] 97. N MD 393 98. E M 241 99. E HD 311 100. S M 451 101. S HD 191 102. W M 313 103. W MD 313 104. N M 351 [N E] 105. N SM 130 132 141 142 150 151 180 182 262 273 281 322 331 340 361 370 351  self-drawn, VeryLongCat won
At the 93-th ply as shown in Fig. 2a, FatesGate decided to hold 3-wan and discarded 9-wan. This was a nice play for the following reason. To win the game, FatesGate’s hand needed at least two effective tiles that can form sequences. However, discarding 3-wan in that state was dangerous since 3-wan might be the exact tile other players needed to win. In addition, the remaining two tiles 9-wan formed a pair needed. It not only avoided a possible chuck but also kept the chance to win. At the 101-th ply as shown in Fig. 2b, FatesGate picked up the tile, red, decided to give up the small chance to win and thus discarded another 9-wan. Finally, VeryLongCat won this game by picking up 5-sou and gained 10500 points at the 105-th ply.

Fig. 2.

VeryLongCat won Game 384 in Match 5.

VeryLongCat won Game 384 in Match 5.

Notes

1 Note that it has no effect in this tournament.

References

1 

Chen, J.-C., Tang, S.-C. & Wu, I-C. ((2022) ). Monte-Carlo simulation for Mahjong. Journal of Information Science and Engineering, 38: , 775–790.

2 

Chen, K.-C. (2022). Design and implementation of computer Mahjong platform. Master’s thesis, National Taipei University, New Taipei City, Taiwan.

3 

Chuang, L.-K. (2015). A study of Mahjong program design. Master’s thesis, National Chiao Tung University, Hsinchu, Taiwan.

4 

Lin, Z.-H. (2021). Using the enhancement strategy from discarded-tiles information to improve Mahjong program. Master’s thesis, National Taiwan Normal University, Taipei, Taiwan.

5 

Shan, Y.-C., Wei, C.-H., Lin, C.-H., Wu, I-C., Chuang, L.-K. & Tang, S.-J. ((2014) ). A framework for computer Mahjong competitions. ICGA Journal, 37: (1), 44–56.

6 

Yeh, C.-H. (2022). The design and implementation of Mahjong program FatesGate. Master’s thesis, National Taipei University, New Taipei City, Taiwan.