Caleb Veenstra > Acme-Mahjong-Rule-CC-0.22 > Acme::Mahjong::Rule::CC

Download:
Acme-Mahjong-Rule-CC-0.22.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.22   Source  

NAME ^

Acme::Mahjong::Rule::CC - Exchange Tables for a Classic Chinese Version of Mahjong.

SYNOPSIS ^

this returns the exchanges of the given scores when the winner is a non-dealer. The equivalent chart form of this exchange would be:

      |win 200  | deal 100 | pl3 50 | pl4 20 |
=============================================|
 win  |    X    |   -400   | -200   | -200   |
 deal |   400   |     X    | -100   | -160   |
 pl3  |   200   |    100   |   X    | -30    |
 pl4  |   200   |    160   |  30    |  X     |
=============================================|
 total|   800   |   -140   | -270   | -390   |

Now since the methods require that the winner comes first(if there is one), and then the dealer you need to rearrage the players in a way such as the following example from mj_series:

Note:

You can find the rest of the source code for mj_series with your distrobution. #!There must be exactly four arguments in dealer(), nondealer(), and draw() otherwise, the function will throw an exception.

DESCRIPTION ^

This module provides functions that table the exchanges of a round of mahjong based off of the given scores. This module mainly applies to the Classic Chinese version of the game, where every hand is scored, not just the winners. Players pay each other the value of the other's hand, dealer pays and recieves double, and winner pays no one.

mahjong_table()

mahjong_table() provides an example of how to use the other functions or gives you a very basic 1-hand mahjong score calculator. It is not included with :tables, you must use :all to be able to use it.

nondealer()

As with all game types, the dealer pays and recieves double, the winner pays no one, but collects from everyone(double from the dealer), and the other players collect normally, while still paying/recieving double from the dealer and paying, but not collecting from the winner.

dealer()

The dealer() function returns the exchanges of the given scores when the dealer is the winner. meaning that the winnner both collects double and pays no one.

draw()

returns the exchanges of the given scores when there is no winner in the form of an array.

EXPORT

None by default.

SEE ALSO ^

Acme::Mahjong::Rule::JP

AUTHOR ^

root, <cjveenst@mtu.edu>

COPYRIGHT AND LICENSE ^

Copyright (C) 2010 by TROTSKEY

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: