Sophie

Sophie

distrib > Mageia > 2 > i586 > media > core-updates > by-pkgid > 0c5a0f3eb9eeb232afe2e71ace7661e5 > files > 100

kde-l10n-handbooks-nl-4.8.5-1.1.mga2.noarch.rpm

<?xml version="1.0" ?>
<!--IMPORTANT: please note that 'Do not change this!' notice does not apply to translators -->
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
  <!ENTITY kajongg  "<application
>Kajongg</application
>">
  <!ENTITY kappname "&kajongg;">
  <!ENTITY kappversion "4.7.0"
><!--Application version. Use this variable everywhere it is needed.-->
  <!ENTITY package "kdegames"
>  <!-- do not change this! -->
  <!ENTITY % Dutch "INCLUDE"
> <!-- change language only here -->
  <!ENTITY % addindex "IGNORE"
> <!-- do not change this! -->
  <!ENTITY s1 "s1">
  <!ENTITY s9 "s9">
  <!ENTITY b1 "b1">
  <!ENTITY b9 "b9">
  <!ENTITY c1 "c1">
  <!ENTITY c9 "c9">
  <!ENTITY we "we">
  <!ENTITY ws "ws">
  <!ENTITY ww "ww">
  <!ENTITY wn "wn">
  <!ENTITY db "db">
  <!ENTITY dr "dr">
  <!ENTITY dg "dg">
  <!ENTITY chow "chow">
  <!ENTITY pung "pung">
  <!ENTITY kong "kong">
  <!ENTITY mahjongg "mahjongg">
  <!ENTITY originalcall "originalcall">
  <!ENTITY violatesoriginalcall "violatesoriginalcall">
  <!ENTITY dangerousgame "dangerousgame">
  <!ENTITY nochoice "nochoice">
  <!ENTITY payforall "payforall">
  <!ENTITY payers "payers">
  <!ENTITY payees "payees">
  <!ENTITY absolute "absolute">
  <!ENTITY lastsource "lastsource">
]>

<book lang="&language;"
> <!-- do not change this! -->
<bookinfo>
	<title
>Het handboek van &kajongg;</title
> <!-- This is the title of this docbook. -->
<!-- List of immidiate authors begins here. -->
<!--INPORTANT! - All other contributors: [to be determined] -->
<authorgroup>
<author
><personname
> <firstname
>Wolfgang</firstname
> <surname
>Rohdewald</surname
> </personname
> <email
>wolfgang@rohdewald.de</email
> </author>
&ged.vertaald;&Freek.de.Kruijf; 
</authorgroup>
<legalnotice
>&FDLNotice;</legalnotice>

<date
>2011-05-11</date
><!-- Date of (re)writing, or update.-->
<releaseinfo
>&kappversion;</releaseinfo
><!-- Application version number. Use the variable definitions within header to change this value.-->

<!--Short description of this document. Do not change unless necessary!-->
<abstract>
	<para
>Deze documentatie beschrijft het spel van &kajongg; versie &kappversion;</para>
</abstract>

<!--List of relevant keywords-->
<keywordset>
	<keyword
>KDE</keyword
> <!-- do not change this! -->
	<keyword
>kdegames</keyword
> <!-- do not change this! -->
	<keyword
>spel</keyword
> <!-- do not change this! -->
	<keyword
>kajongg</keyword
><!--Application name goes here-->
<!-- Game genre. Use as many as necessary. Available game types are: Arcade, Board, Card, Dice, Toys, Logic, Strategy.-->
	<keyword
>bord</keyword>
	<keyword
>arcade</keyword>
	<keyword
>spel met stenen</keyword>
	<keyword
>stenen</keyword>
<!--Number of possible players. It can be: One, Two,..., Multiplayer-->
	<keyword
>vier spelers</keyword>
<!--All other relevant keywords-->
</keywordset>
</bookinfo>
<!--Content begins here: -->
<chapter id="introduction"
><title
>Inleiding</title
> <!-- do not change this! -->
	<note
><title
>Speltype:</title
><para
>Bord, Arcade</para
></note
><!-- Game genre. Use as many as necessary. Available game types are: Arcade, Board, Card, Dice, Toys, Logic, Strategy.-->
	<note
><title
>Aantal mogelijke spelers:</title
><para
>Vier</para
></note
><!--Number of possible players. It can be: One, Two,..., Multiplayer-->
	<para
>&kajongg; is een bordspel gemaakt volgens het beroemde oosterse spel Mah Jong (in Chinees <foreignphrase lang="zh"
>麻將</foreignphrase
>). Het wordt gespeeld door vier spelers. Wereldwijd zijn er verschillende spelregels in gebruik. Op dit moment ondersteunt &kajongg; de klassieke Chinese spelregels zoals deze gespeeld worden in Duitsland, mogelijk kunnen andere spelregels volgen. Het is mogelijk om deze aan te passen of nieuwe spelregels toe te voegen. Doe dat en stuur deze naar de auteur van het programma voor integratie! </para>
	<para
>&kajongg; kan op twee verschillende manieren worden gebruikt: de score bijhouden van een handmatig spel waar u speelt zoals u gewend bent zonder de hulp van een computer en gebruikt u &kajongg; voor het berekenen van de scores en voor bijhouden van de boeken. Of u kunt &kajongg; gebruiken om tegen elke combinatie van andere menselijke spelers of computerspelers te spelen. </para>
</chapter>

<chapter id="screen_layout"
><title
>De indeling van het scherm</title>
		<para>
			<screenshot>
				<screeninfo
>Een schermafdruk van &kajongg;</screeninfo>
				<mediaobject>
					<imageobject>
						<imagedata fileref="gamescreen.png" format="PNG"/>
					</imageobject>
					<textobject
><phrase
>Schermafdruk</phrase
></textobject>
				</mediaobject>
			</screenshot>
                </para>
                <para
>Een korte uitleg van de onderdelen van het speelveld. </para>
	<variablelist>
		<varlistentry>
			<term
>Werkbalk</term>
			<listitem
><para
>De werkbalk bevindt zich onder de menubalk en bevat knoppen voor de meest vaak gebruikte acties. De inhoud van de werkbalk kan worden beweerkt. U kunt deze ook onzichtbaar maken, waardoor er meer ruimte is voor het bord. </para
><para
>Afhankelijk van de afmetingen van uw scherm wilt u de werkbalk onzichtbaar maken of het naar de linkerkant van het venster verplaatsen. Dat kan door met de muis rechts te klikken op de werkbalk. </para
></listitem>
		</varlistentry>
		<varlistentry>
			<term
>Bord</term>
			<listitem
><para
>Het bord is het grootste gedeelte van het venster. U ziet de vier muren met een lengte van 18 stenen (het exacte aantal hangt af van de regels zoals het gebruik van bonusstenen of niet). De namen van de spelers staan op de muur, samen met de huidige waarde van de hand (voor zover bekend) en hun winden-stenen. De wind van de ronde heeft een gekleurde achtergrond, Oost in de bovenstaande schermafdruk. </para
><para
>When <link linkend="play"
>playing</link
>, the interior of the walls holds the tiles discarded by the players. They are randomly placed. The last discarded tile has a blue focus frame. </para
><para
>When <link linkend="scoreGame"
>scoring manual games</link
>, the interior of the walls has a selection of all available tiles, the central selector. You can assign them to the players using the mouse or the keyboard. </para>
			</listitem>
		</varlistentry>
		<varlistentry>
			<term
>Speelgebied</term>
			<listitem
><para
>Every player has a screen range for her tiles. The upper row contains exposed tiles, the lower row concealed tiles. When <link linkend="scoreGame"
>scoring manual games</link
>, concealed tiles are shown with a shadow over the entire tile. Bonus tiles go to the right end. </para
></listitem>
		</varlistentry>
		<varlistentry>
			<term
>Dialoog</term>
			<listitem
><para
>De dialoog presenteert keuzes die de speler heeft. Vaak heeft het een timeout met een voortgangsbalk die de overblijvende tijd aangeeft. </para
></listitem>
		</varlistentry>
		<varlistentry>
			<term
>Statusbalk</term>
			<listitem
><para
>De statusbalk bevindt zich onderaan het scherm en bevat de huidige totalen van de spelers. </para
></listitem>
		</varlistentry>
	</variablelist>
</chapter>

<chapter id="scoreGame"
><title
>Scores van een handmatig spel</title
> <!-- do not change this! -->
	<para
>In this mode, &kajongg; is only used to do the scoring. You play as usual with real people on a real table and at the end of a game you can tell &kajongg; the tiles a player has in her hand and everything else &kajongg; needs to know for calculating the scores - which is what the program will do. Alternatively you can calculate the hand scores manually and enter them. &kajongg; will then make the payments amongst the players and write the results into a data base. It is possible to suspend a game, start another game with other players and resume old games. All rules will be saved together with the games, so different games can be played with different rules. </para>
        <itemizedlist>
            <listitem
><para
>Selecteer uit het menu <guimenu
>Spel</guimenu
> / <guimenuitem
>Scores van een handmatig spel</guimenuitem
> of druk op <keycombo action="simul"
>&Ctrl;<keycap
>C</keycap
></keycombo
>. </para
></listitem>
            <listitem
><para
>Now you can either select an existing unfinished game or start a new game. If you start a new game, you will be asked for the players and the ruleset. &kajongg; will propose the same values used for the previous game. If there was no previous game, it will propose the first four defined players. Please note that you cannot change the ruleset or any of its rules after this selection. You can do that beforehand in <link linkend="ruleset-options"
>the ruleset editor</link
>. </para
></listitem>
            <listitem
><para
>U krijgt nu een nieuw venster met de titel "Voer de handmatige resultaten in". Lees <link linkend="enterhand-tiles"
>Laat &kajongg; de score berekenen</link
> voor een gedetailleerde beschrijving. </para
></listitem>
            <listitem
><para
>Na het opslaan van handmatige resultaten, doorgaan met de volgende hand. </para
></listitem>
        </itemizedlist>
      <sect1 id="enterhand"
><title
>Handmatige resultaten invoeren</title>
        <sect2 id="enterhand-scores">
	<title
>Scores</title>
	<screenshot>
		<screeninfo
>Een schermafdruk van &kajongg;</screeninfo>
		<mediaobject>
			<imageobject>
				<imagedata fileref="enterhand.png" format="PNG"/>
			</imageobject
>				<textobject
><phrase
>Schermafdruk</phrase
></textobject>
		</mediaobject>
	</screenshot>
	<para
>This is the window for entering hand results. It automatically shows itself when &kajongg; thinks you might need it. You can always show or hide it by pressing <keycombo action="simul"
>&Ctrl;<keycap
>S</keycap
></keycombo
> or by selecting the corresponding menu entry. </para>
	<para
>Zoals altijd heeft de wind van de ronde een gekleurde achtergrond. </para>
	<para
>Here you can manually enter scores for all players. Alternatively you can exactly define which tiles a player had in her hand. If you choose to do that, the corresponding field for the manual score value will be grayed out. &kajongg; will automatically compute the score. </para>
	<para
>After having entered all relevant data for a hand, press the button <guibutton
>Save Hand</guibutton
>. The hand values will be entered in the data base, and they are also entered in the score table. You might be prompted to change the seating positions of the players but you can choose not to change seats. The proposed changes are currently not customizable - if a ruleset needs something different, we will change that. </para>
	<para
>If the player might have won, the check box in the column "Winner" will be enabled - click this for the winner. </para>
	<para
>The status bar will now show the updated balances for the players, and you can continue with the next hand. </para>
	<sect3 id="enterhand-manually">
	<title
>Enter the score manually</title>
	<para
>A good player will probably prefer to compute her score himself. In that case you can directly enter it. This is only possible when no tiles are selected for this player. </para>
	<para
>If you enter a manual score, it must already contain everything except penalties, you will have no optional rules to choose from. There is one exception: "Dangerous Game". This does not influence any scores, it is no offense either. It only means the payment between players is different: The offender pays all for all to the winner. The other two players do not exchange payments. This is currently not customizable. </para>
	</sect3>
	<sect3 id="enterhand-tiles">
	<title
>Have &kajongg; compute the score</title>
	<para
>If you explicitly tell &kajongg; what tiles a player holds, entering scores will be grayed out for that player in this window. While associating tiles with a player you will see how her score will grow - but as soon as you add the 14th tile the score goes to zero. That might surprise you but unless you declare this as the winner hand, it is recognized as a long hand which always has zero points. This behaviour is defined by the Classical Chinese ruleset, it might be different if you change the rules or use a different ruleset. </para>
	<para
>You can associate tiles and melds with a player using either the mouse or the keyboard or both. With the mouse simply move tiles by dragging/dropping them to the player region. When dropping the tile, you will be asked what you want to move: Single, Pair, Pung, Kong, Claimed Kong or Chow. The upper row is for exposed tiles, the lower row for concealed tiles. The bonus tiles will appear to the far right. You can also move tiles and melds between rows, between players and back to the central selector. </para>
	<para
>If you prefer using the keyboard, you can use &Tab; to move between the central selector and the player regions. The keys <keycap
>eswnESWN</keycap
> move a tile to the players East, South, West and North. The keys <keycap
>xX</keycap
> move it back to the central selector. <keycap
>ESWN</keycap
> moves to the concealed row, <keycap
>eswn</keycap
> moves to the exposed row. You can move the cursor between tiles or melds using the arrow keys, the currently selected tile or meld has a blue frame. Since the key arrows are far away from letters on the keyboard, you can also use the letters <keycap
>hjkl</keycap
> or <keycap
>HJKL</keycap
> for moving the cursor. <keycap
>hH</keycap
> move left, <keycap
>jJ</keycap
> move down, <keycap
>kK</keycap
> move up, <keycap
>lL</keycap
> move right. This is how the unix editor "vi" does it. The &kde; browser konqueror and even this help program also support those keys in the same way. Those keys may differ if you use a language other than English but it is currently not possible to configure them. </para>
	<para
>The options "Last Tile" and "Last Meld" are needed by some rules like "last tile completes pair". They can only be used for the winner hand. </para>
	<para
>In the right part of the window you can manually apply some rules. What rules appear in this list depends on the current ruleset and on the tiles. In the example of the above screen shot, the losing players might have an option "dangerous game" - again depending on the ruleset and on their tiles. It is the aim of the developers to keep this list of manually selectable rules as short as possible. Optimally &kajongg; should always be able to automatically determine whether a rule applies, but sometimes &kajongg; does not have enough information or knowledge to decide. </para>
	</sect3>
	</sect2>
	<sect2 id="enterhand-penalties">
	<title
>Strafpunten</title>
			<screenshot>
				<screeninfo
>Een schermafdruk van &kajongg;</screeninfo>
				<mediaobject>
					<imageobject>
						<imagedata fileref="penalty.png" format="PNG"/>
					</imageobject>
					<textobject
><phrase
>Schermafdruk</phrase
></textobject>
				</mediaobject>
			</screenshot>
	<para
>In the <link linkend="enterhand"
>window for entering hand results</link
>, the <guibutton
>Penalties</guibutton
> button will bring up this window where you can enter penalties. This can be done at any point in time independent of the normal scoring mechanism.</para>
	<para
>The <guilabel
>Offense</guilabel
> selection shows all offenses that might be applicable to the hands the players hold. Choose among them.</para>
	<para
>Now you can adapt the <guilabel
>Total Penalty</guilabel
>. This is the total sum that is moved from payers to payees. It will be evenly split between them.</para>
	<para
>Depending on the type of offense, the number of payers and payees varies. The right number of players is displayed. If you select a player, &kajongg; ensures that this player only occurs once by adapting the other players. </para>
	</sect2>
	</sect1>
</chapter>

<chapter  id="play"
><title
>Speelt</title>
	<para
>At any time, you can enable or disable the Demo Mode. In Demo Mode, the computer will play for you. If no game is currently played, a new game will be started with the last used ruleset. </para>
        <sect1 id="robotplay">
        <title
>Play against the computer</title>
         <para
>First you will get a login dialog. Enter the game server you want to connect to and your user name. If you choose the special entry "Local Game", you only need to enter your name (or accept the proposed name) and the wanted ruleset. This will immediately start a local game where you play against 3 robot players. However if suspended games exist, they will be displayed in a list. You can then select the game you want to continue with or start a new game. </para>
        </sect1>
        <sect1 id="humanplay">
        <title
>Play with friends</title>
        <para
>If you want to play against other real people, you need a game server to which all players, including yourself, need to connect. Do that by selecting any other host or by manually entering a new host name and by specifying your password for that host. The last used password will be proposed. </para
><para
>If you do not have an account on that server with the name you entered, you will be asked if you want to open an account. If you say yes, you will get a new dialog where you can enter the wanted password twice. Your account will be created automatically. </para
><para
>After a successful login onto the game server, you will get a list of tables with available seats on that game server. Join a table or allocate a new table. If you allocate a new table, wait until more seats are taken by other players. You can start the game on a table you allocated at any time, the seats not taken will be filled by robot players. </para
><para
>The table list also shows the name of the ruleset played on that table. The ruleset and its name are sent to the game server by the player initiating the table. If you have an identical ruleset, the table shows your name for the ruleset - this might be helpful if the table initiator speaks another language and named the ruleset differently. Also, if the name of your local ruleset is displayed, it is displayed in black. If however you have no identical ruleset, the name appears in red, and you can use the button <guibutton
>Compare</guibutton
> to compare it with your own rulesets. </para
><para
>You can start the &kajongg; game server in two different ways: <itemizedlist
><listitem
><para
>connect to the server "localhost". This is your own computer. If you do this and no game server is running, it will be started automatically. And when you stop playing, the server will be stopped too. </para
></listitem
><listitem
><para
>manually start a server on any computer you want. All you need to do is go to a command line and start the program "kajonggserver". Entering "kajonggserver --help" will show you all available options like changing the default port 8149. This server will run until you kill it. </para
></listitem
></itemizedlist>
        </para
><para
>In both cases you need to tell the other players how they can reach your game server. They need the &URL; or simply an IP address and the port your server is listening on. This might be something like "mypc.dyndns.org:8149" where 8149 is the port. Of course you need to configure your firewall such that the remote player can reach that port. The communication will be encrypted. </para
><para
>If you encounter possible bugs, you might want to use the option "--showtraffic". This will show you, on the console where the game server has been started, what messages are flowing between the game server and the clients. </para>
        <sect2 id="playing-caveats">
        <title
>Notities</title>
            <itemizedlist
><listitem
><para
>If you want to make sure nobody can cheat none of the human players should have access to the computer the game server is running on. Of course you can never avoid that two players help each other because you cannot know what they really are doing. Two players might even be one and the same person. </para
></listitem
></itemizedlist>
        </sect2>
        </sect1>
<sect1  id="gamerules"
><title
>Spelregels</title>
<para
>Worldwide, many different game variants exist. Right now we only describe the rules for Classical Chinese as played in Germany. However most of the basic rules are the same in most variants.</para>
  <para
>Since the program &kajongg; knows how to play, this description only contains things that might not be obvious.</para>
  <para
>If you want to learn Mah Jong in more detail, please consult the <link linkend="bibliography"
>bibliography</link
>.</para>
<sect2 id="gamerules-aim">
  <title
>The aim of the game</title>
  <para
>Each player tries to collect tiles such that she has a winning hand. On achieving this, she calls "Mah Jong". In a winning hand, the tiles are normally grouped into five melds: Four melds with three or four tiles each and a fifth meld consisting of two equal tiles. A normal meld has three or four identical tiles (called Pung and Kong respectively) or three successive tiles like Bamboo 3, Bamboo 4, Bamboo 5 (called Chow).</para>
  </sect2
>     
  <sect2>
    <title
>The course of the game</title>
    <para
>Initially, the player with the East wind (as indicated on the wall) has one more tile than the other players. East begins by discarding an unwanted tile. </para>
    <para
>Whenever a tile has been discarded, other players can claim it by saying what they can complete with that tile (Chow, Pung, Kong, Mah Jong). Only the next player can claim a Chow - the other claims are possible for all players. A meld completed by a claim will be exposed - made visible to all players. </para
><para
>If nobody claims the discarded tile, the next player, South (and then West and North) gets a tile from the wall and discards an unwanted tile.</para>
      <para
>There are several rules about when a Pung can be extended to a Kong (by claiming the forth tile or by getting it from the wall) - these rules are not explained here. But &kajongg; of course knows them and makes sure they are respected. If a Kong is declared, the player automatically gets a replacement tile from the wall - otherwise it would not be possible to build the five melds as mentioned above. </para>
    </sect2>
    <sect2>
      <title
>Jaar, ronde en hand</title
><para
>When a player claims Mah Jong or we end up in a draw, a hand is completed. Now, except for draws, the winds rotate among the players. This is repeated until every player once had every wind. This entire unit is called a round. An entire game, also called year, consists of four such rounds: East wind round, South wind round, West wind round, North wind round. The wind of a round is also called prevailing wind, it can result in higher scores.</para>
	<para
>So a full game (a year) consists of at least 16 hands. Since the winds do not rotate for draws or when the East player says Mah Jong, a higher number of hands is normally needed for a full game. </para
></sect2
><sect2
><title
>Bonusstenen</title>
    <para
>A game can contain eight bonus tiles (unless the rules exclude them). They are exposed separately on the right side of the player region as they are never used for building melds. They do however generate bonus points.</para>
      <para
>Als een speler een bonussteen ontvangt, zal deze automatisch ook een vervangende steen van de muur ontvangen.</para
></sect2>
      <sect2
><title
>Scoren</title
><para
>Aan het eind van een hand wordt de score voor elke speler berekend. Eerst worden de basispunten geteld zoals 2 punten voor een eenvoudige open pung of 20 punten voor het winnen. Vervolgens wordt een andere set regels toegepast - deze regels kunnen de punten verdubbelen zoals een verdubbeling voor een melding van draken. Wanneer de score voor elke hand bekend is, worden de verschillen tussen de spelers afgerekend - terwijl de winnaar zijn volledige score van alle andere spelers krijgt betaald. Oost krijgt en betaalt altijd twee keer zijn score.</para>
	  <para
>Of course &kajongg; knows about all applicable rules but a good player knows what combinations get what score so she can optimize. While learning it is recommended to activate the window <guimenuitem
>Explain Scores</guimenuitem
>.</para>
	  <para
>The exact scoring rules often vary - in &kajongg; you are free to change them with the <link linkend="ruleset-options"
>the ruleset editor</link
>.</para>
	  <para
>The ruleset editor also shows you all available rules and their meaning. Place the mouse over them and for the more exotic rules help text will appear.</para>
	</sect2>
</sect1>
<sect1 id="playing-play">
        <title
>Hoe met &kajongg; te spelen</title>
        <para
>You will be prompted for what you want to do. This is a little dialog which appears either on the right or at the bottom depending on the size of the window. If you make it broader than high, the dialog appears on the right. Sometimes the dialog will have a timeout - when it is over, the first possible answer is automatically selected for you. This timeout is configurable in the Ruleset Editor, under <guilabel
>Options</guilabel
>, <guilabel
>Claim Timeout</guilabel
>. All players should have the same timeout, that is why this is part of the ruleset. </para
><para
>If you need to select a tile from your hand, you can move between tiles using the right and left arrow keys or the letters h and l on your keyboard. Of course you can use the mouse too. </para
><para
>You can discard a tile by using the keyboard the same way as for all actions. Alternatively, you can use the mouse and move the tile from your hand into the discard area (the interior of the walls). The placement of the tile in the discard area will still be done by the computer - because the placement should be the same for players. </para
><para
>Often, the dialogs will offer choices which are not really applicable like calling Pung when you do not have the needed tiles. This is intended - just like in a real game. </para
><para
>Discarded tiles are placed randomly between the walls. Some game variants define where the tiles should be placed, this is not yet configurable however. When it becomes configurable, it will be part of the ruleset. </para>
	</sect1>
</chapter>

<chapter id="interface"
><title
>Overzicht van het interface</title
> <!-- do not change this! -->
<!-- This section has to do with menubar. Describe every single entry in order. Use <variablelist
> and <varlistentry
>. Split the chapter into sections using <sect1(2,3)
> for better viewing.-->

 <sect1 id="game-menu">
	<title
>Het menu <guimenu
>Spel</guimenu
></title>
		<variablelist>
			<varlistentry id="game-menu-scoreGame">
				<term
><menuchoice
><guimenu
>Spel</guimenu
> <guimenuitem
>Score van handmatige spel</guimenuitem
> </menuchoice
></term>
				<listitem
><para
><action
>Hou de score bij van een handmatig gespeeld spel.</action
></para
><para
>You can load an old game or start a new game. By default only pending (i.e. unfinished) games are shown in the selection list. You can optionally show all games including finished games. Here you can also delete games.</para
></listitem>
			</varlistentry>
                        <varlistentry  id="game-menu-play">
                                <term
><menuchoice
><guimenu
>Spel</guimenu
> <guimenuitem
>Spelen</guimenuitem
> </menuchoice
></term>
                                <listitem
><para
><action
>Spelen met anderen (mensen en computers)</action
></para
></listitem>
                        </varlistentry>
                        <varlistentry  id="game-menu-abort">
                                <term
><menuchoice
><guimenu
>Game</guimenu
> <guimenuitem
>Abort</guimenuitem
> </menuchoice
></term>
                                <listitem
><para
><action
>Abort the current game. If it was a manual game with scoring only, you can resume it later. If you played using &kajongg;, the game is not yet resumable.</action
></para
></listitem>
                        </varlistentry>
			<varlistentry>
				<term
><menuchoice
><guimenu
>Game</guimenu
> <guimenuitem
>Quit</guimenuitem
> </menuchoice
></term>
				<listitem
><para
><action
>Beëindigt</action
> &kappname;.</para
></listitem>
			</varlistentry>
		</variablelist>
</sect1>
<sect1 id="view-menu">
	<title
>Het menu <guimenu
>Beeld</guimenu
></title>
		<variablelist>
                        <varlistentry id="view-scoring">
                                <term
><menuchoice
><guimenu
>View</guimenu
> <guimenuitem
>Scoring</guimenuitem
> </menuchoice
></term>
                                <listitem
><para
><action
>Scoring Dialog</action
>: Show or hide the scoring dialog. This dialog is explained <link linkend="enterhand"
>here</link
>. </para
></listitem>
                        </varlistentry>
                        <varlistentry id="view-scoretable">
                                <term
><menuchoice
><guimenu
>View</guimenu
> <guimenuitem
>Score Table</guimenuitem
> </menuchoice
></term>
                                <listitem
><para
><action
>Score Table</action
> <screenshot
> <screeninfo
>Score Table</screeninfo
> <mediaobject
> <imageobject
> <imagedata fileref="scoretable.png" format="PNG"/> </imageobject
> <textobject
> <phrase
>Screenshot</phrase
> </textobject
> </mediaobject
> </screenshot
> Show the score table. Round/Hand are the current round (East, South, West, North) followed by a count of the hands played in that round. The winner has a green background for her values. The Payments show how much the player paid to or received from all other players with this hand. The Balance shows the current balance for all players. The Chart shows the development of the balance values. The hints give you more details: They show all rules that have been applied to this hand. Just move the mouse over the value you are interested in.</para
><para
>The lower part shows the used ruleset. Between the score table and the used ruleset you can find a splitter letting you change the relative sizes of both parts. </para
></listitem>
                        </varlistentry>
			<varlistentry id="view-explain-scores">
				<term
><menuchoice
><guimenu
>View</guimenu
> <guimenuitem
>Explain Scores</guimenuitem
> </menuchoice
></term>
				<listitem
><para
><action
>Explain Scores</action
> <screenshot
> <screeninfo
>Score Table</screeninfo
> <mediaobject
> <imageobject
> <imagedata fileref="explain.png" format="PNG"/> </imageobject
> <textobject
> <phrase
>Score Table</phrase
> </textobject
> </mediaobject
> </screenshot
> Explains how the score for the current hand was computed. </para
></listitem>
			</varlistentry>
		</variablelist>
</sect1>
<sect1 id="settings-menu">
	<title
>Het menu <guimenu
>Instellingen</guimenu
></title>
		<variablelist>
			<varlistentry>
				<term
><menuchoice
><guimenu
>Settings</guimenu
> <guimenuitem
>Players</guimenuitem
> </menuchoice
></term>
				<listitem
><para
><action
>Add, modify and delete players.</action
></para>
				<para
>The passwords in this table are those used by default when logging onto a game server. Changing the password you initially chose for a game server is not yet really helpful because there is no way yet for you to also change your password on the game server. You would have to ask the administrator of the game server to do that for you directly in the data base.</para
></listitem>
			</varlistentry>
			<varlistentry>
				<term
><menuchoice
><guimenu
>Settings</guimenu
> <guimenuitem
>Change Visual Angle</guimenuitem
> </menuchoice
></term>
				<listitem
><para
><action
>Changes the viewing angle of the tiles counterclockwise.</action
></para
></listitem>
			</varlistentry>
			<varlistentry>
				<term
><menuchoice
><guimenu
>Instellingen</guimenu
><guimenuitem
>Demomodus</guimenuitem
> </menuchoice
></term>
				<listitem
><para
><action
>Enables or disables the Demo Mode. See <link linkend="play"
>here</link
> for details.</action
></para
></listitem>
			</varlistentry>
			<varlistentry id="settings-menu-statusbar">
				<term
><menuchoice
><guimenu
>Instellingen</guimenu
> <guimenuitem
>Statusbalk tonen</guimenuitem
> </menuchoice
></term>
				<listitem
><para
><action
>Toont of verbergt de statusbalk.</action
></para
></listitem>
			</varlistentry>
			<varlistentry>
				<term
><menuchoice
><guimenu
>Instellingen</guimenu
> <guimenuitem
>Volledig schermmodus</guimenuitem
> </menuchoice
></term>
				<listitem
><para
><action
>Switches between full screen mode and normal mode.</action
></para
></listitem>
			</varlistentry>
			<varlistentry id="settings-menu-shortcuts">
				<term
><menuchoice
><guimenu
>Instellingen</guimenu
> <guimenuitem
>Sneltoetsen instellen...</guimenuitem
> </menuchoice
></term>
				<listitem
><para
><action
>Displays a standard &kde; shortcut configuration dialog</action
> for the <link linkend="default-keybindings"
>keyboard shortcuts</link
> for &kappname;.</para
></listitem>
			</varlistentry>
			<varlistentry id="settings-menu-toolbar">
				<term
><menuchoice
><guimenu
>Instellingen</guimenu
> <guimenuitem
>Werkbalken instellen...</guimenuitem
> </menuchoice
></term>
				<listitem
><para
><action
>Opent een standaard &kde;-dialoog waarin u de pictogrammen op de werkbalken kunt instellen.</action
></para
></listitem>
			</varlistentry>
			<varlistentry id="settings-menu-settings">
				<term
><menuchoice
><guimenu
>Settings</guimenu
> <guimenuitem
>Configure &kappname;...</guimenuitem
> </menuchoice
></term>
				<listitem
><para
><action
>Opens a <link linkend="configuration"
>configuration dialog</link
> for &kappname;.</action
></para
></listitem>
			</varlistentry>
			<varlistentry>
				<term
><menuchoice
><guimenu
>Instellingen</guimenu
> <guimenuitem
>Werkbalk tonen</guimenuitem
> </menuchoice
></term>
				<listitem
><para
><action
>Toont of verbergt de werkbalk.</action
></para
></listitem>
			</varlistentry>
		</variablelist>
</sect1>
 <sect1 id="help"
><!--This is a standard Help menubar entry. Only change if needed.-->
<title
>Het menu <guimenu
>Help</guimenu
></title>
&help.menu.documentation; </sect1>
</chapter>

<chapter id="configuration"
><title
>Spelconfiguratie</title
> <!-- do not change this! -->
<!--This section describes configuration &GUI;. If your game is configured using menubar exclusively, please remove this section.-->
<screenshot>
<screeninfo
>Dialoog voor instellen</screeninfo>
	<mediaobject>
	  <imageobject>
	    <imagedata fileref="config_play.png" format="PNG"/>
	  </imageobject>
	  <textobject>
	    <phrase
>Dialoog voor instellen</phrase>
	  </textobject>
	</mediaobject>
</screenshot>

<para
>The menu entry <menuchoice
><guimenu
>Settings</guimenu
><guimenuitem
>Configure &kappname;...</guimenuitem
></menuchoice
> opens the <guilabel
>Configure - &kappname;</guilabel
> dialog.</para>
<para
>If you press the <guibutton
>Cancel</guibutton
> button here, all of your configuration changes will be reverted, including everything you did with the ruleset editor.</para>
<para
>You can also select the different tabs with the keyboard: <keycombo action="simul"
>&Ctrl;<keycap
>1</keycap
></keycombo
> selects the first tab <guilabel
>Play</guilabel
> options, <keycombo action="simul"
>&Ctrl;<keycap
>2</keycap
></keycombo
> selects the second tab, and so on. </para>

<sect1 id="play-options"
><title
><guilabel
>Play</guilabel
> options</title>
		<variablelist>
			<varlistentry>
				<term>
					<guilabel
>Schaduw van stenen tonen</guilabel>
				</term>
				<listitem
><para
>This shows tiles with borders and shadows. Also there is some space between tile rows, and the wall tiles are shown such that you can see that the wall is two or three tiles high. So if you disable this option, you have a simpler display with slightly larger tiles. This may be helpful for small screens. </para
></listitem>
			</varlistentry>
			<varlistentry>
				<term>
					<guilabel
>Blinde stenen naar meldingen herschikken</guilabel>
				</term>
				<listitem
><para
>This groups melds in the hand. Sometimes the grouping might not be like you want it, so you might prefer to have no grouping at all, just like in a real world game. </para
></listitem>
			</varlistentry>
			<varlistentry>
				<term>
					<guilabel
>Alleen nog mogelijke acties tonen</guilabel>
				</term>
				<listitem
><para
>When playing, show only possible actions like "No claim" or "Pung". </para
></listitem>
			</varlistentry>
			<varlistentry>
				<term>
					<guilabel
>Geluid gebruiken indien beschikbaar</guilabel>
				</term>
				<listitem
><para
>This lets you hear discards and claims. If other players recorded sound files with their own voice, you can hear them. </para
></listitem>
			</varlistentry>
			<varlistentry>
				<term>
					<guilabel
>Laat anderen mijn stem horen</guilabel>
				</term>
				<listitem
><para
>If you recorded sound files with your voice this option will let the other players hear your discards and claims with your voice. </para
></listitem>
			</varlistentry>
			<varlistentry>
				<term>
					<guilabel
>Animatiesnelheid</guilabel>
				</term>
				<listitem
><para
>Define how fast the tiles should move around. If you move the slider to the rightmost position, tile movement is not animated: the tiles will simply change place. </para
></listitem>
			</varlistentry>
		</variablelist>

	<sect2
><title
>Geluid</title>
	<para
>It is possible to record sound files for your announcements which will be heard by the other players. There is some manual work needed: </para>
            <itemizedlist
><listitem
><para
>First you need to find out where to store your voice files. This folder normally is ~/.kde/share/apps/kajongg. So if your login name is joe, this might be /home/joe/.kde/share/apps/kajongg. In there you will also find the database kajongg.db. </para
></listitem
><listitem
><para
>In the folder you just located, generate a new subfolder with the name <filename class="directory"
>voices</filename
>. </para
></listitem
><listitem
><para
>In the folder <filename class="directory"
>voices</filename
> generate another subfolder with your player name. This is the name you use when connecting to a game server. You may also want to define voices for the players <filename
>ROBOT 1</filename
>, <filename
>ROBOT 2</filename
>, <filename
>ROBOT 3</filename
>. </para
></listitem
><listitem
><para
>In that subfolder, you can place the sound files. They have to be encoded with the <ulink url="http://xiph.org/vorbis/"
>Ogg Vorbis</ulink
> audio compressor, the file names need to have the extension <filename class="extension"
>.ogg</filename
>. </para
></listitem
><listitem
><para
>A single file has a name like <filename
>s3.ogg</filename
> - this is Stone 3. You should define such files for all tiles and for all claims and announcements. </para
></listitem
></itemizedlist>
            <para
>Please make the length of the sound short but speak clearly - this game can be played very fast when you get used to it. It is easier if you first write down a list with everything that should be spoken. Do not read it as a sequence of items, try to pronounce each item as if it were the only one and as you would when playing. Reading this needs a little practicing.</para>
            <para
>This is just one possibility to create the sound files: </para
><para
><itemizedlist
><listitem
><para
>Record a sound file with the program <command
>qarecord</command
>, save it in the <literal
>WAV</literal
> format. In this single sound file, speak all of the sounds. </para
></listitem
><listitem
><para
>Edit that file with the sound editor <command
>audacity</command
>. In that editor, use the mouse to mark a range of the sound waves. The editor will play that part. Repeat until you have the correct part selected. This may be easier if you <menuchoice
><guimenu
>View</guimenu
><guimenuitem
>Zoom In</guimenuitem
></menuchoice
>. Use the menu command <menuchoice
><guimenu
>File</guimenu
><guimenuitem
>Export Selection</guimenuitem
></menuchoice
> and save in the ogg format. Under <guilabel
>Options</guilabel
>, choose low quality - this is sufficient and even wanted because this reduces the time to transfer the sounds to the other players. </para
></listitem
></itemizedlist
></para>
            <para
>The following are the names of the files that you should generate. Always append <filename
>.ogg</filename
> to them:</para>

<table>
<title
>Sound file names</title>
<tgroup cols="2">
<tbody>
<row>
<entry
>&s1; .. &s9;</entry
><entry
>Stone 1 to Stone 9</entry>
</row>
<row>
<entry
>&b1; .. &b9;</entry>
<entry
>Bamboo 1 to Bamboo 9</entry>
</row>
<row>
<entry
>&c1; .. &c9;</entry>
<entry
>Character 1 to Character 9</entry>
</row>
<row>
<entry
>&we; &ws; &ww; &wn;</entry>
<entry
>The winds East, South, West, North</entry>
</row>
<row>
<entry
>&db; &dr; &dg;</entry>
<entry
>The dragons blue/white, red, green</entry>
</row>
<row>
<entry
>&chow; &pung; &kong; &mahjongg;</entry>
<entry
>The major claims</entry>
</row>
<row>
<entry
>&originalcall; &violatesoriginalcall;</entry>
<entry
>Original call and its violation</entry>
</row>
<row>
<entry
>&dangerousgame;</entry>
<entry
>A player lets off a cannon (dangerous game)</entry>
</row>
<row>
<entry
>&nochoice;</entry>
<entry
>A player declares he has no choice but to play dangerous game</entry>
</row>
</tbody>
</tgroup>
</table>
	</sect2>
</sect1>

<sect1 id="tiles-options"
><title
>Opties voor de <guilabel
>Stenen</guilabel
></title>
        <screenshot>
                <screeninfo
>Tileset selector</screeninfo>
                <mediaobject>
                        <imageobject>
                                <imagedata fileref="config_tiles.png" format="PNG"/>
                        </imageobject>
                        <textobject
><phrase
>Tileset selector</phrase
></textobject>
                </mediaobject>
        </screenshot>
	<para
>Use the <guilabel
>Tiles</guilabel
> selector to select graphics for the tiles. </para>
</sect1>

<sect1 id="background-options"
><title
>Opties voor de <guilabel
>Achtergrond</guilabel
></title>
        <screenshot>
                <screeninfo
>Achtergrond kiezen</screeninfo>
                <mediaobject>
                        <imageobject>
                                <imagedata fileref="config_background.png" format="PNG"/>
                        </imageobject>
                        <textobject
><phrase
>Achtergrond kiezen</phrase
></textobject>
                </mediaobject>
        </screenshot>
	<para
>Use the <guilabel
>Background</guilabel
> selector to select a background graphic for the game. </para
><para
>Some backgrounds like the Chinese Landscape need some time to load. If you feel that the program should start faster or that resizing the main window takes too long, you might try some other background. </para>
</sect1>

<sect1 id="ruleset-options"
><title
>Ruleset Editor</title>
			<screenshot>
				<screeninfo
>Ruleset Editor</screeninfo>
				<mediaobject>
					<imageobject>
						<imagedata fileref="ruleseteditor.png" format="PNG"/>
					</imageobject>
					<textobject
><phrase
>Ruleset Editor</phrase
></textobject>
				</mediaobject>
			</screenshot>
			<para
>Use the Ruleset Editor to customize rulesets. Predefined rulesets are shown in an italic font, customized rulesets have a normal font. Predefined rulesets cannot be changed by the user in any way, however an update of &kajongg; might. Customized rulesets will never be affected by an update. </para
><para
>When starting a new game, you will be able to select a ruleset for that game. All rulesets defined in the ruleset editor can be used. The ruleset is saved together with the game, so you can always change rulesets here - your changes will only affect future games. </para>
			<sect2
><title
>Rule, Score and Unit</title
><para
>Simply double click on whatever you want to change.</para>
			</sect2>
			<sect2
><title
>Definitie</title
><para
>The definition for a rule can be rather complex. There is a separate chapter <link linkend="rule"
>Defining a Rule</link
> for this. You will normally not have to change a definition. This essentially defines to what hands the rule applies.</para>
			</sect2>
			<sect2
><title
>Copy and Remove</title
><para
>You can copy entire rulesets or single rules within a ruleset. Since predefined rulesets are immutable, single rules can only be copied within customized rulesets. </para
><para
>You can remove entire customized rulesets or single rules within them. Again this can even be done if existing games use this ruleset since every game has its own ruleset copy. You can view rulesets for old games: <link linkend="game-menu-scoreGame"
>Load</link
> the old game and <link linkend="view-menu"
>show its score table</link
>. </para>
			</sect2>
			<sect2
><title
>Vergelijken</title
><para>
			<screenshot>
				<screeninfo
>Ruleset Comparator</screeninfo>
				<mediaobject>
					<imageobject>
						<imagedata fileref="differ.png" format="PNG"/>
					</imageobject>
					<textobject
><phrase
>Ruleset Comparator</phrase
></textobject>
				</mediaobject>
			</screenshot>
You can select this command when an entire ruleset is selected. It lets you compare the selected ruleset against any other ruleset. </para
></sect2>
</sect1>

<sect1 id="default-keybindings">
<title
>Standaard sneltoetsen</title>

<para
>The menu entry <menuchoice
><guimenu
>Settings</guimenu
><guimenuitem
>Configure ...</guimenuitem
></menuchoice
> allows you to change the default keyboard bindings.</para>

<para
>De standaard sneltoetsen zijn als volgt: </para>

<para>
<variablelist>

<varlistentry>
<term
><keycap
>F1</keycap
></term>
<listitem>
<para
>Hierdoor wordt dit handboek geopend. </para>
</listitem>
</varlistentry>

<varlistentry>
<term
><keycombo action="simul"
>&Ctrl;<keycap
>C</keycap
></keycombo
></term>
<listitem>
<para
>Score van handmatig spel. </para>
</listitem>
</varlistentry>

<varlistentry>
<term
><keycombo action="simul"
>&Ctrl;<keycap
>N</keycap
></keycombo
></term>
<listitem>
<para
>Play a game with friends or computer players. </para>
</listitem>
</varlistentry>

<varlistentry>
<term
><keycombo action="simul"
>&Ctrl;<keycap
>W</keycap
></keycombo
></term>
<listitem>
<para
>Het huidige spel afbreken. </para>
</listitem>
</varlistentry>

<varlistentry>
<term
><keycombo action="simul"
>&Ctrl;<keycap
>Q</keycap
></keycombo
></term>
<listitem>
<para
>Beëindig het programma </para>
</listitem>
</varlistentry>

<varlistentry>
<term
><keycombo action="simul"
>&Ctrl;<keycap
>T</keycap
></keycombo
></term>
<listitem>
<para
>Show the score table. </para>
</listitem>
</varlistentry>

<varlistentry>
<term
><keycombo action="simul"
>&Ctrl;<keycap
>G</keycap
></keycombo
></term>
<listitem>
<para
>Change the viewing angle. </para>
</listitem>
</varlistentry>

<varlistentry>
<term
><keycombo action="simul"
>&Ctrl;<keycap
>D</keycap
></keycombo
></term>
<listitem>
<para
>Enables or disables the Demo Mode. </para>
</listitem>
</varlistentry>

<varlistentry>
<term
><keycombo action="simul"
>&Shift;<keycap
>F1</keycap
></keycombo
></term>
<listitem>
<para
>Wat is dit? Hulp </para>
</listitem>
</varlistentry>

<varlistentry>
<term
><keycombo action="simul"
>&Ctrl;&Shift;<keycap
>F</keycap
></keycombo
></term>
<listitem>
<para
>Volledig scherm modus </para>
</listitem>
</varlistentry>

</variablelist>
</para>

</sect1>
</chapter>

<chapter id="rule"
><title
>Defining a Rule</title>
<para
>The scoring engine and many other aspects of &kajongg; can be customized with the ruleset editor. A rule consists of a name, a score (including its unit) and a <link linkend="ruledefinition"
>definition</link
>. </para>
        <sect1 id="rulegroups">
        <title
>Rule Groups</title>
        <para
>There are several groups of rules:</para>
        <variablelist>
                <varlistentry>
                        <term
>Spelregels voor melden</term>
                        <listitem
><para
>Spelregels voor melden worden toegepast op enkele meldingen onafhankelijk van de rest van de hand. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>Spelregels voor de hand</term>
                        <listitem
><para
>Spelregels voor de hand worden toegepast op de gehele hand en voor alle spelers. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>Spelregels voor Mah Jong</term>
                        <listitem
><para
>Mah Jong rules specify how a winnable hand has to look like. This is normally four melds with 3 or 4 tiles each and a pair. But special hands may look differently, for example the 13 Orphans in Classical Chinese. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>Spelregels voor winnaars</term>
                        <listitem
><para
>Winner rules are applied to the entire hand but only for the winner. This includes most special hands. Those rules do not have to enforce the correct number of tiles. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>Opties</term>
                        <listitem
><para
>Here you can find several special parameters like points for a limit hand. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>Strafpunten</term>
                        <listitem
><para
>Strafpunten worden handmatig toegepast door de gebruiker. </para
></listitem>
                </varlistentry>
        </variablelist>
        <sect2 id="executionorder"
><title
>Order of Execution</title>
        <para>
                <itemizedlist>
                        <listitem
><para
>build a list of applicable rules from meld rules and hand rules</para
></listitem>
                        <listitem
><para
>using the Mah Jong rules find out if the declared winner hand is really a winner hand.</para
></listitem>
                        <listitem
><para
>for the winner append applicable winner rules</para
></listitem>
                        <listitem
><para
>if some of the found rules have the action '&absolute;', only keep those. It is yet undefined what happens if more than one is found.</para
></listitem>
                        <listitem
><para
>if some of the rules define limits, throw away all others</para
></listitem>
                        <listitem
><para
>apply the found rules in that order</para
></listitem>
                </itemizedlist>
        </para>
        </sect2>
        </sect1>
        <sect1 id="ruledefinition">
        <title
>The Definition</title>
        <para
>The definition is one single string because we want to make it easy to save it in a data base. It consists of several parts separated by the two characters "||". A part expresses either a condition under which the rule applies or it expresses some actions. Only one part for actions may be defined, but several condition expressions. The rule applies as soon as at least one condition expression matches the hand.</para
><para
>&kajongg; comes with a predefined ruleset implementing the Classical Chinese rules as defined by the German DMJL. That should give you a lot of examples.</para
><para
>These are all recognized parts:</para>
        <variablelist>
                <varlistentry>
                        <term
>Variable Case Regular Expression</term>
                        <listitem
><para
>A part starting with I is a <link linkend="regex"
>Regular Expression</link
> making no difference between upper/lowercase. However case is only ignored in the first, main part of the regular expression. For the parts starting with m,M,x or L, case always matters. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>Actie</term>
                        <listitem
><para
>A part starting with A is a list of <link linkend="actions"
>Actions</link
>. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>Manual Expression</term>
                        <listitem
><para
>A part starting with M is an optional <link linkend="regex"
>Regular Expression</link
>. For scoring manual games, it defines whether this rule should be selectable by the user with a check box. The leading M does not belong to the Regular Expression. An example would be the Rule "Last Tile Taken from Dead Wall". </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>Functie</term>
                        <listitem
><para
>A part starting with F is a function. Sometimes regular expressions would be too complicated or too slow. In such cases the rule is encoded in the program itself, and it can be referenced here by giving its function name. As of now, only one function <literal
>LastOnlyPossible</literal
> is defined. This function determines if the last tile was the only tile possible for winning. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>Reguliere expressie</term>
                        <listitem
><para
>Any other part is a <link linkend="regex"
>Regular Expression</link
>. </para
></listitem>
                </varlistentry>
        </variablelist>
        </sect1>
        <sect1 id="regex">
        <title
>Reguliere expressies</title>
        <para
>Regular expressions are a very powerful programming tool for matching strings of characters. Powerful but also quite difficult. This is not for the normal game player. There are books available which do nothing else but explain regular expressions.</para>
        <para
>There are several dialects of regular expressions. &kajongg; is written in the programming language Python. Since the Python standard library contains a module for regular expressions, this is the dialect we use. </para
><para
>For details see <ulink url="http://docs.python.org/library/re.html#regular-expression-syntax"
></ulink
> </para
><para
>Everything about a hand that might have an influence on the score is encoded in one single string. Then &kajongg; checks if the regular expression matches this string. If it does, the rule is applied.</para>
        <para
>As an example, this regular expression matches the limit hand "All Greens":</para
><programlisting
>( |[bB][23468]|[dD]g)*[fy/]</programlisting>
        <sect2
><title
>Structure of a Hand String</title>
        <para
>The content of a hand string is always the same no matter what language you use on your desktop.</para>
        <para
>The string representing a hand consists of several parts separated by a space. The order of those parts is always the same except for the meld parts at the beginning.</para>
        <para
>&kajongg; is able to regroup concealed tiles into melds aiming to get a higher score. It does not matter how the concealed tiles are grouped for this to work. However when it comes to limit hands this might fail. That is why &kajongg; will try the original grouping of tiles as entered by the user and also the regrouped tiles. For both variants, all rules are applied. The variant achieving the higher total score is used.</para>
        <para
>Here comes an example. This is really only one line but split here for better readability. Moreover this sentence is repeated once because some regular expressions are much easier to write if the parts can be referenced in another order. See the rule for Robbing the Kong: Its regular expression first looks at the L group (Last Tile) before looking at the melds.</para
><programlisting
><literal>c1c1c1C1 s1s2s3 b6b6b7b7b8b8 b5b5 fn yn
/c416s000b000b000b200 -C416s000b000b000b200 %n Mneka LB5B5B5</literal></programlisting>
<para
>A tile is represented by 2 characters. The first one is s for stone, b for bamboo, c for character, w for wind, d for dragon, y for season bonus, f for flower bonus. The second one is 1..9 for the suits, e,s,w,n for the winds, w,r,g for the dragons (white, red, green) and 1,2,3,4 for the bonus tiles. Exposed tiles have the first character in lowercase, concealed tiles have it in uppercase.</para>
<para
>All the following parts are always present in this order except the part "Last Tile": This one exists only for the winner hand. <variablelist>
                <varlistentry>
                        <term
>Meld</term>
                        <listitem
><para
>The part starting with any of the characters <literal
>sbcdwSBCDW</literal
> is a meld. A meld holds any number of tiles. &kajongg; will split melds with too many tiles trying to maximize the score.</para
><para
>We use a special syntax for kongs: c1c1c1c1 is an open kong. c1c1c1C1 is an open kong, 4th tile was called for, completing a concealed pung. This is needed for the limit game 'concealed true color game'. c1C1C1c1 is a concealed declared kong. C1C1C1C1 would be a concealed undeclared kong. But since it is undeclared, it is counted as a pung. So this meld will be split into pung C1C1C1 and single C1.</para
><para
>Bonus tiles appear after all other melds.</para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>Samenvatting</term>
                        <listitem
><para
>The part starting with / holds summary information about the melds. This makes it easier to write some regular expressions. Every meld is represented by four characters. The first character is one out of <literal
>sbcdwSBCDW</literal
>, again lowercase for exposed and uppercase for concealed. The second character is a number saying how many tiles the meld holds. This is 1 up to 4 for a kong. The 0 is used for a chow. The last two characters hold the scoring points for this meld. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>Alternate summary</term>
                        <listitem
><para
>The part starting with - is identical to the above summary but it contains claimed kongs as concealed kongs. Some rules like "Three Concealed Pongs" treat a claimed kong as being concealed. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>Hand length</term>
                        <listitem
><para
>The part starting with % holds information about the length of the hand: s is a short hand having too few tiles, n is a hand with the correct number of tiles, l is a long hand having too many tiles. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>Mah Jong</term>
                        <listitem
><para
>The part starting with m, M or x holds additional information. M stands for the winner hand, m for a loser hand, and x stands for a hand that is forbidden to say Mah Jong. M/m/x is followed by one character for the own wind, one character for the prevailing wind, one character for the source of the last tile leading to Mah Jong, one character for the declarations a player made.</para
><para
>These are the possible sources of the last tile: w=wall, d=discarded, e=dead end, z=last tile of living end, Z=last tile of living end, discarded, k=robbing the kong, 1=blessing of heaven/earth. The values w and d are special - they are sort of intermediate values. By choosing a concealed tile as last tile, the source is set to w. Next, several rules say that they apply only if the last tile comes from the wall. So this allows for a better preselection of actually applicable manual rules. For a better understanding, please look at the manual rules and read up about the <link linkend="actions"
>action</link
> &lastsource;.</para
> <para
>These are the possible declarations: a=call at beginning, t=twofold fortune. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>Laatste steen</term>
                        <listitem
><para
>The part starting with L holds information about the last tile. It contains the last tile itself, followed by the meld that was completed with the last tile. We need this last meld for the rule "Last Tile is the Only Possible" because sometimes knowing only the last tile is not sufficient. Note that the last meld cannot be a Kong because if it completes a Kong you have to draw a replacement tile. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>Calling Limit Hand</term>
                        <listitem
><para
>This is not yet implemented but might be needed for rules like defined by the BMJA (in England). A part starting with K holds all possible tiles to be checked for if we give points for a calling limit hand. We could use brute force and check with every tile but that might take too much time. </para
></listitem>
                </varlistentry>
        </variablelist>
        </para>
        </sect2>
        </sect1>
        <sect1 id="actions">
        <title
>Acties</title>
        <para
>All actions for a rule are defined in one string. They are separated by spaces. Some of them define a value. </para>
        <variablelist>
                <varlistentry>
                        <term
>&payforall;</term>
                        <listitem
><para
>The player did something very nasty, so she must pay for all. Yet this is not a penalty since the sum of payments is the same - only the payer changes. Also, the two payers not involved do not exchange payments. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>&payers;=X</term>
                        <listitem
><para
>Defines how many payers this penalty rule implies. X is a number. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>&payees;=X</term>
                        <listitem
><para
>Defines how many payees this penalty rule implies. X is a number. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>&absolute;</term>
                        <listitem
><para
>This action defines an absolute payment. The hand score is ignored. Used for penalty rules. </para
></listitem>
                </varlistentry>
                <varlistentry>
                        <term
>&lastsource;</term>
                        <listitem
><para
>This action defines the source of the last tile. Used by manual rules like "last tile from dead end". Setting the last source with this action serves as a filter for other rules - if they trigger only for certain sources. Those other rules can of course also be manual rules. So this filtering will narrow down the amount of manual rules the user gets shown in the scoring dialog. If this seems complicated, just play around with the scoring dialog and watch check boxes appear and disappear depending on the source of the last tile. </para
></listitem>
                </varlistentry>
        </variablelist>
        </sect1>
</chapter>

<appendix id="problems"
><title
>Known problems</title>
        <itemizedlist>
                <listitem
><para
>It is not yet possible for the player herself to open an account on the game server.</para
></listitem>
                <listitem
><para
>In playing mode, penalties are not yet possible.</para
></listitem>
                <listitem
><para
>The computer players are still rather stupid.</para
></listitem>
                <listitem
><para
>The names of the computer players are not yet customizable.</para
></listitem>
        </itemizedlist>
</appendix>

<appendix id="future"
><title
>Possible future features</title>
        <itemizedlist>
                <listitem
><para
>Add more rulesets. This should optionally be done by people using those rulesets regularly.</para
></listitem>
        </itemizedlist>
</appendix>

 <appendix id="faq"
><title
>Veel voorkomende vragen</title
> <!-- do not change this! -->
<!--This chapter is for frequently asked questions. Please use <qandaset
> <qandaentry
> only!-->
<qandaset>
<!--Following is a standard list of FAQ questions.-->
        <qandaentry>
                 <question
><para
>Ik wil het uiterlijk van dit spel wijzigen. Kan dat? </para
></question>
                 <answer
><para
>Ja. Om het uiterlijk van &kajongg; te wijzigen gebruikt u de <link linkend="settings-menu-settings"
>menubalk</link
> om het <link linkend="configuration"
>configuratieprogramma</link
> te openen.</para
></answer>
        </qandaentry>
        <qandaentry>
                 <question
><para
>Can I use the keyboard to assign tiles to players?</para
></question>
                 <answer
><para
>Yes. See <link linkend="enterhand-tiles"
>Have &kajongg; compute the score</link
></para
></answer>
        </qandaentry>
<!--Please add more Q&As if needed-->

</qandaset>
</appendix>

<appendix id="credits"
><title
>Dankbetuigingen en licentie</title
> <!-- do not change this! -->
<!--This chapter is for credits and licenses.-->
	<para
>&kajongg; for &kde; </para>

	<para
>Programma copyright &copy; 2009, 2010, 2011 <personname
><firstname
>Wolfgang</firstname
><surname
>Rohdewald</surname
></personname
> <email
>wolfgang@rohdewald.de</email
> </para>
	<para
>Documentatie copyright &copy; 2009, 2010, 2011 <personname
><firstname
>Wolfgang</firstname
><surname
>Rohdewald</surname
></personname
> <email
>wolfgang@rohdewald.de</email
> </para>

<!-- !!!do not change ANYTHING after this line!!!! -->
&meld.fouten;&vertaling.freek; 
&underFDL;
&underGPL;

</appendix>

<appendix id="bibliography">
<title
>Bibliografie</title>
        <itemizedlist>
		<listitem
><para
>Das Chinesische Mah-Jongg-Spiel by Uwe Martens 2005, Books on Demand GmbH, Norderstedt. Dit boek is een uitstekende Duitse referentie die alles bevat wat u wilt weten over de spelregels die in Duitsland worden gebruikt en vele andere aspecten van het spel.</para
></listitem>
                <listitem
><para
>The Complete Book of Mah-Jongg door A. D. Millington, 1977 (met verschillende paperback edities tot 2003), Weidenfeld &amp; Nicolson, London. Dit is de beste referentie voor Klassiek Chinees Mah Jong zoals het gespeeld wordt in de Westerse wereld. Het kan u waardevolle aanwijzingen geven over spelstrategieën.</para
></listitem>
		<listitem
><para
>Mah-Jong by Gwyn Headley and Yvonne Seeley, 3rd edition, 2008, A &amp; C Black Publishers Ltd., London. This book is a very easy to use reference, concentrating on the rules as used in Great Britain, defined by the BMJA (The British Mah Jong Association).</para
></listitem>
		<listitem
><para
><ulink url="http://en.wikipedia.org/wiki/Mahjong"
></ulink
></para
></listitem>
		<listitem
><para
><ulink url="http://de.wikipedia.org/wiki/Mahjongg"
></ulink
></para
></listitem>
        </itemizedlist>
</appendix>

<appendix id="installation">
<title
>Installatie</title>
<para
>Use the .deb package from <ulink url="http://www.kde-apps.org/content/show.php/kajongg?content=103206"
></ulink
>. If it does not work for you, you can download kajongg-x-y.tar.gz from the same address and then do: <programlisting
>tar xfz kajongg-x-y.tar.gz
cd kajongg-x-y
./setup.py install
</programlisting>
</para
><para
>In both cases you will manually have to make sure that some other required packages are installed. The debian package does not yet contain these requirements. &kajongg; needs: (corresponding debian packages in parentheses) </para>
<itemizedlist>
	<listitem
><para
>the KDE4 games library (libkdegames5)</para
></listitem>
	<listitem
><para
>Python 2.5 or higher (python)</para
></listitem>
	<listitem
><para
>QT4.4 or higher (libqt4-core, libqt4-gui, libqt4-svg, libqt4-sql, libqt4-sql-sqlite)</para
></listitem>
	<listitem
><para
>De python bindings voor QT4 (python-qt4, python-qt4-sql)</para
></listitem>
	<listitem
><para
>de python bindings voor KDE4 (python-kde4)</para
></listitem>
        <listitem
><para
>de bibliotheek python twisted (python-twisted-core)</para
></listitem>
        <listitem
><para
>sqlite3 (libsqlite3-0)</para
></listitem>
</itemizedlist>

</appendix>

&documentation.index;
</book>
<!--
Local Variables:
mode: sgml
sgml-minimize-attributes:nil
sgml-general-insert-case:lower
sgml-omittag:t
sgml-shorttag:t
sgml-namecase-general:t
sgml-always-quote-attributes:t
sgml-indent-step:0
sgml-indent-data:nil
sgml-parent-document:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->