Shanten: Difference between revisions

132 bytes added ,  3 July 2023
m
Fix min() in maximum shanten formula
(Also expand the 3-shanten wait list based on the same computer program. For example, you can pick up a 2 pin, 3 pin and 6 pin while discarding the 2 sou and the isolated wind tiles. This will leave you in tenpai on a closed wait for 5 sou.)
m (Fix min() in maximum shanten formula)
 
(2 intermediate revisions by one other user not shown)
Line 5: Line 5:


===Iishanten===
===Iishanten===
{{main|Iishanten}}
'''Example''': 1-shanten
'''Example''': 1-shanten
:{{#mjt:456p111m246s1155z}}  Needs: Any {{#mjt:35s15z}} to tenpai.
:{{#mjt:456p111m246s1155z}}  Needs: Any {{#mjt:35s15z}} to tenpai.
Line 34: Line 35:
Maximum shanten can easily be estimated by naïvely removing groups from the hand, then counting pairs, then taatsu. Assuming no pairs are present, the worst shanten count is always 6. Removing different possible groups will lead to different results: the lowest result from the universe of removable groups is the correct result. Taking away 345 from 1123456 is entirely possible in the process but removing 123 and 456 is clearly more optimal. With more complex hands, it is less obvious which tiles to remove: it is essential to test every possibility '''or''' skip obvious possibilities, such as if a quad occurs, it makes sense to check the first set of three, and skip over the rest, continuing from the 4th tile and the following two.
Maximum shanten can easily be estimated by naïvely removing groups from the hand, then counting pairs, then taatsu. Assuming no pairs are present, the worst shanten count is always 6. Removing different possible groups will lead to different results: the lowest result from the universe of removable groups is the correct result. Taking away 345 from 1123456 is entirely possible in the process but removing 123 and 456 is clearly more optimal. With more complex hands, it is less obvious which tiles to remove: it is essential to test every possibility '''or''' skip obvious possibilities, such as if a quad occurs, it makes sense to check the first set of three, and skip over the rest, continuing from the 4th tile and the following two.


  ''maximumShanten'' = max(8 - 2 * ''groups'' - max(''pairs'' + ''taatsu'', floor(''hand.length''/3)-''groups'') - min(1, max(0, ''pairs'' + ''taatsu'' - (4 - ''groups''))), 6).
  ''maximumShanten'' = min(8 - 2 * ''groups'' - max(''pairs'' + ''taatsu'', floor(''hand.length''/3)-''groups'') - min(1, max(0, ''pairs'' + ''taatsu'' - (4 - ''groups''))), 6).


=== Accurate shanten ===
=== Accurate shanten ===
Line 51: Line 52:
[[Category: Terminology]]
[[Category: Terminology]]
[[Category: Strategy]]
[[Category: Strategy]]
* [https://pathofhouou.blogspot.com/2019/05/calculating-shanten-and-ukeire.html Calculating Shanten and Ukeire]


{{navbox strategy}}
{{navbox strategy}}