10/23/2023 0 Comments Mahjong simple sequence hand![]() Input is a list of digits (as a string or a single flat list of integers) via STDIN, function argument or command line. fourteen tiles from 1 to 9 and each tile appearing at most four times, and may be assumed to be already sorted. The input hand is guaranteed to be valid, i.e. If a hand can be decomposed in more than one way, take the highest scoring decomposition. The score of a hand is the sum of points for the conditions it satisfies. ![]() (Scoring here is based off Japanese mahjong rules, but heavily simplified to make the spec less messy.) Identical sequences Contains two identical sequences 1Īll sequences All sets of three are sequences 1Īll triplets All sets of three are triplets 2įlush Single-suit hand (always applies) 5 Straight Contains the sequences 123 456 789 1 Given a valid hand of fourteen tiles, determine its score based on the following criteria: Condition Description Point/s Sequences do not wrap (so 912 is invalid).Ī pair is simply two identical tiles (e.g. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |