Help:MahjongTile: Difference between revisions
(almost done) |
(No difference)
|
Revision as of 01:50, 31 July 2013
MahjongTile is a MediaWiki extension that makes it easy to output sequences of mahjong tile images, for example:
by use of the parser function #mjt
. Specifically, it converts tile strings into their corresponding sequence of wiki markup image insertions, e.g.:
19p -> [[File:Tile-1p.png]][[File:Tile-9p.png]]
The rest of this article describes how to use it.
Usage
The command can be invoked at any point in the wiki markup.
Syntax
{{ #mjt: tile string | size option }}
Tile string
The tile string is similar to the way people communicate strings of tiles through text. First, an example, and its output:
Code | Result |
---|---|
{{#mjt: 123m}} |
The 123
part is self-explanatory, and the m
part stands for man. 123m
is called the tile string.
In general, a tile sequence consists of a series of digits (0 through 9) followed by a descriptor character describing which set they belong to. There are four groups:
Group | Descriptor | Full array (code) | Full array |
---|---|---|---|
Man | m |
{{#mjt: 0123456789m}} |
|
Pin | p |
{{#mjt: 0123456789p}} |
|
Sou | s |
{{#mjt: 0123456789s}} |
|
Jihai | z |
{{#mjt: 0123456789z}} |
More complex configurations can also be described, by simply concatenating strings like above. Another example:
Code | Result |
---|---|
{{#mjt: 456m789s}} |
Spaces in a tile string are also ignored, so the following are equivalent:
123m1111z 123m 1111z 123m 1111z 1 23m1111z 123m11 11z 12 3m1111 z 1 23 m1 11 1z ...
The jihai group (see the table above) can also be used to refer to "unknown" or "face-down" tiles, as is often convenient when describing certain components of a hand. Example:
Code | Result |
---|---|
The iipeikou yaku looks something like: {{#mjt: 345345m00000000z}} |
The iipeikou yaku looks something like: |
Tile orientation
There are additional flags that can be applied to specific tiles or entire tile groupings that adjust their orientation.
Orientation | Flag |
---|---|
Sideways ("pointing east/right") | '
|
Sideways ("pointing west/left") | "
|
These can be applied after a digit, affecting that individual tile only, or after a descriptor, then affecting the entire sequence of tiles in that grouping. The following examples should make this clear:
Size option
This is the size option you would pass to any image. First, an explanation with a regular image:
Code | Result |
---|---|
[[File:Canard_plastique.jpg|200px]] |
File:Canard plastique.jpg |