Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Hand Scoring - Doubles

The point value for a hand can be doubled a number of times for a variety of rare achievements. Most of these rules of these are additional properties of Sets that are summarized by the Hand.

Each non-pair Set that contains lucky tiles is worth 1 double (2×). In the case of the player's wind being the prevailing wind, a Set of this wind is worth 2 doubles (4×)

A hand of four ThreeSet or FourSet (i.e., no SequenceSet) merits a double. Depending on how the hand was played and how many of these triples were concealed or melded, the hand can have a second double, or possibly even pay the house limit, something we'll look into in the section called “Limit Hands”. For now, we are ignoring these mechanics of play issues, and will simply double the score if there are no SequenceSets.

A hand that has three consecutive SequenceSets in the same suit is doubled. There are many rule variations on this theme, including same-rank sequences from all three suits, same-rank ThreeSets or FourSets from all three suits. We'll focus on the three-consecutive rule for now.

If the hand is worth exactly 20 points (it is all SequenceSets and an unlucky PairSet), then it merits one double.

There are six different consistency tests. These are exclusive and at most one of these conditions will be true.

  1. If the hand is all terminals and honors (no simples), it is doubled.

  2. If each set in the hand has one terminal or an honor in it, the hand is doubled. A hand could have four SequenceSets, each of which begins with one or ends with nine, and a pair of honors or terminals to qualify for this double.

  3. If the hand is all simples (no terminals or honors), it is doubled.

  4. If all of the SuitTiles are of the same suit, and all other tiles are HonorsTiles, this is doubled.

  5. If all of the SuitTiles are of the same suit, and there are no HonorsTiles, this is doubled four times (16×).

  6. If the hand contains Sets of all three dragons, and one of those sets is a PairSet, this is called the Little Three Dragons, and the hand's points are doubled.

There are a few more ways to add doubles, all related to the mechanics of play, not to the hand itself.

Update Set Class Hierarchy. You'll need to add the following functions to the Set classes.

  • A lucky function that returns True for a ThreeSet or FourSet with lucky tiles (dragons, the prevailing wind or the player's wind. It returns False for other kinds of Sets or Sets without lucky tiles.

  • A triplet function that returns True for a ThreeSet or FourSet. It returns False for other kinds of Sets.

  • A sequenceSuit function that returns the suit of a SequenceSet. It returns None for other kinds of Sets.

  • A sequenceRank function that returns the lowest rank of a SequenceSet. It returns None for other kinds of Sets.

  • An allSimple function that returns True if the Set contains only simple tiles.

  • An noSimple function that returns True if the Set contains no simple tiles. This is an all terminals and honors Set.

  • An oneTermHonor function that returns True if the Set contains one terminal or honor. Since we only have a simple function, this is one non-simple Tile in the Set.

  • An suit function that returns the suit for a Set of all SuitTiles (either SimpleSuitTiles or TerminalSuitTiles). It returns None if the Set contains HonorsTiles.

  • An bigDragon function that returns True for a TreeSet or FourSet of dragons.

  • An littleDragon function that returns True for a PairSet of dragons.

Update Hand Class. You'll need to add the following functions to the Set classes.

  • luckySets( prevailWind , myWind ) returns the number of lucky sets. This function also checks for the double wind conditions where prevailWind is the same as myWind and one of the Sets has this condition and throws an additional doubling in for this.

  • groups returns 1 if all Sets have the triple property True.

  • sequences returns 1 if three of the Sets have the same value for sequenceSuit, and the values for sequenceRank are 1, 4, and 7.

  • noPoints returns 1 all of the Sets are worth zero points.

  • consistency returns 1 or 4 after checking for the following conditions. If allSimple is true for all Sets, return 1. If noSimple is true for all Sets, return 1. If oneTermHonor is true for all Sets, return 1. If every Set has the same value for suit and there are no Set where suit is None, return 4. If every Set has the same value for suit or the value for suit is None, return 1. If there are two Sets for which bigDragon is true, and one Sets for which littleDragon is true, return 1.

The sum of the double functions is the total number of doubles for the hand. This is d = luckySets( prevailWind , myWind ) + groups + sequences + noPoints + consistency . This sum is the power of 2 to use: the score is multiplied by 2 d . An amazing hand of all one suit with three consecutive sequences leads to 5 doubles, 32× the base number of points.

You'll want to add a doubleReport which prints a small scorecard for the hand, showing each double that was awarded. You can then write a scoreCard which products the pointReport, the doubleReport and the final score of points × 2 doubles .

The total score is often rounded to the nearest 10, as well as limited to 500 or less to produce a final score. This final score is used to settle up the payments at the end of the game.


 
 
  Published under the terms of the Open Publication License Design by Interspire