Mahjong programming tests: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with "Every programmer who has previously tackled attempting to test and verify the veracity of his functions should at one point have attempted to run a set of tests. == Shanten t...")
 
No edit summary
Line 7: Line 7:


Tile formats are offered in string arrays and MPSZ format.
Tile formats are offered in string arrays and MPSZ format.
<pre>
 
"7,17,29,41,53,67,77,89,101,111,113,117,127"
{| class="wikitable"
|-
! String array !! MPSZ format
|-
| <pre>"7,17,29,41,53,67,77,89,101,111,113,117,127"
"7,11,29,41,53,67,71,89,101,111,113,115,127"
"7,11,29,41,53,67,71,89,101,111,113,115,127"
"7,11,31,33,53,57,73,79,101,105,115,117,127"
"7,11,31,33,53,57,73,79,101,105,115,117,127"
Line 20: Line 24:
"3,17,33,37,53,71,72,101,111,113,117,118,127"
"3,17,33,37,53,71,72,101,111,113,117,118,127"
"3,32,33,37,53,71,72,106,111,113,117,118,127"
"3,32,33,37,53,71,72,106,111,113,117,118,127"
"3,32,34,37,68,71,88,91,111,113,117,118,127"
"2,32,34,68,71,88,91,112,113,117,118,124,127"
"2,32,34,68,71,88,91,112,113,117,118,124,127"
"1,6,9,41,53,67,77,89,101,111,113,117,127"
"1,6,9,41,53,67,77,89,101,111,113,117,127"
"1,2,3,41,53,67,77,89,101,111,113,117,127"
"1,2,3,41,53,67,77,89,101,111,113,117,127"


"13,17,29,37,53,67,73,89,101,111,113,117,127,135"
"13,17,29,37,53,67,73,89,101,111,113,117,127,135"</pre>|| <pre>"258m258p258s1235z"
</pre>
<pre>
"258m258p258s1235z"
"238m2589p58s1225z"
"238m2589p58s1225z"
"2389m56p1289s235z"
"2389m56p1289s235z"
Line 39: Line 41:
"159m159p18s12335z"
"159m159p18s12335z"
"199m159p19s12335z"
"199m159p19s12335z"
"199m199p55s22335z"
"199m199p55s12335z"
"199m99p55s223355z"
"199m99p55s223355z"
"123m258p258s1235z"
"123m258p258s1235z"
"111m258p258s1235z"
"111m258p258s1235z"


"458m158p158s12357z"
"458m158p158s12357z"</pre>
</pre>
|}
 
 
=== Elements tested ===
=== Elements tested ===
7, 17, 29: 6-shanten. All crap, 4 terminals.
7, 17, 29: 6-shanten. All crap, 4 terminals.<br />
7, 11, 29: 5-shanten. 3 protogroups, 5 terminals.
7, 11, 29: 5-shanten. 3 protogroups, 5 terminals.<br />
7, 11, 31: 4-shanten. 5 protogroups without pair.
7, 11, 31: 4-shanten. 5 protogroups without pair.<br />
9, 11, 31: 3-shanten. 5 protogroups including a pair.
9, 11, 31: 3-shanten. 5 protogroups including a pair.<br />
9, 10, 11: 2-shanten. 1 group, 4 protogroups including a pair.
9, 10, 11: 2-shanten. 1 group, 4 protogroups including a pair.<br />
8, 10, 11: 1-shanten. 2 groups, 3 protogroups including a pair.
8, 10, 11: 1-shanten. 2 groups, 3 protogroups including a pair.<br />
8, 9, 10: Tenpai (0-shanten). 3 groups, 2 protogroups including a pair.
8, 9, 10: Tenpai (0-shanten). 3 groups, 2 protogroups including a pair.<br />
6, 17, 35: 6-shanten. All crap, 7 different terminals (no pair).
6, 17, 35: 6-shanten. All crap, 7 different terminals (no pair).<br />
6, 17, 34: 5-shanten. All crap, 8 different terminals (no pair).
6, 17, 34: 5-shanten. All crap, 8 different terminals (no pair).<br />
6, 17, 33: 4-shanten. All crap, 8 different terminals, one terminal pair.
6, 17, 33: 4-shanten. All crap, 8 different terminals, one terminal pair.<br />
3, 17, 33: 3-shanten. All crap, 9 different terminals, one terminal pair. (13-10)
3, 17, 33: 3-shanten. All crap, 9 different terminals, one terminal pair. (13-10)<br />
3, 32, 33: 2-shanten. All crap, 10 different terminals, two terminal pairs. (13-11)
3, 32, 33: 2-shanten. All crap, 10 different terminals, two terminal pairs. (13-11)<br />
3, 32, 34: 1-shanten. 5 pairs, no groups.
3, 32, 34: 1-shanten. 5 pairs, no groups.<br />
2, 32, 34: Tenpai (0-shanten). 6 pairs.
2, 32, 34: Tenpai (0-shanten). 6 pairs.<br />
1, 6, 9: 6-shanten. One group (sequence), rest crap.
1, 6, 9: 6-shanten. One group (sequence), rest crap.<br />
1, 2, 3: 5-shanten. One group (triplet), rest crap (pair present obv.).  
1, 2, 3: 5-shanten. One group (triplet), rest crap (pair present obv.). <br />


13, 17, 29: 6-shanten. Mostly crap, 6 terminals, 1 protogroup, no pair. (14 tiles start)
13, 17, 29: 6-shanten. Mostly crap, 6 terminals, 1 protogroup, no pair. (14 tiles start)
478

edits

Navigation menu