Skip to content

Instantly share code, notes, and snippets.

// Imagine if we had a test framework that did this :...(
const models = require('../models')
const logger = require('../logger')
const Promise = require('bluebird')
const co = require('co')
const isGenFn = require('is-generator').fn
const colors = require('colors/safe')
function transactionStrategy(mocha) {

Mah Jong Classic Chinese Scoring, Simplified

  1. Keep track of which groups in the winning hand are concealed and which were open (revealed).
  2. Calculate base points (consider each group one at a time). See base table below. Round up to next 10.
  3. Double the base a number of times to get the score for the round. See doubles table below.
  4. Cap the score at 1000 (the limit).
  5. If the winning tile came from a discard, each player pays the winner their score, and the loser pays double.
  6. If the winning tile came from the wall, all players pay the winner double the score.
  7. Losers do not score their hands.

Base