Awalé Game
##########

**Awalé** or Oware_ is a game of great antiquity, and has been played
around the world in various forms for millenia.  Currently it is the
official board game of Africa.

.. _Oware: http://en.wikipedia.org/wiki/Oware

Member of the mancala_ family of board games.  There are many variants
to the rules of this game, which is for two players.

.. _mancala: http://en.wikipedia.org/wiki/Mancala

.. contents::


Quick Start
===========

Launch
------

After being installed, simply launch::

  $ pyawale

See ``--help`` for more options.

Command line options
--------------------

-a ALGO, --algo=ALGO     Choose the algorithm to use (bfs, minimax, maxi, negamax or alphabeta).
-l LEVEL, --level=LEVEL  Set the difficulty level of the game.

-c, --cli                Switch to command-line interface (default if Pygame not installed). 


Command Line Interface
======================

::

  mickey@bunny:~$ pyawale --cli

    pyAwale is a free software available under the terms of the GNU GPL.
    Refer to the file COPYING (which should be included in this distribution)
    for the specific terms of this licence.
    You can freely download pyAwale and enjoy to play with it.
  
  pyAwale> help

  Documented commands (type help <topic>):
  ========================================
  EOF  algo  display  info  level  sow

  Undocumented commands:
  ======================
  help

  pyAwale> display
               f    e    d    c    b    a
  North ( 0) [ 4] [ 4] [ 4] [ 4] [ 4] [ 4]
             [ 4] [ 4] [ 4] [ 4] [ 4] [ 4] ( 0) South
               A    B    C    D    E    F
  pyAwale>

Commands
--------

:info: Display engine settings/parameters.
:algo: Display/toogle to another algorithm 
       (bfs, minimax, maxi, negamax or alphabeta).
:level: Display/set default level of the algorithm (1, 2 or 3).

:display: Show board state and score.
:sow: Sow and capture from given cup (A, B, C, D, E or F); 
      Then, compute adversary move.

:EOF: Exit (C^D under \*nix and C^Z under Windows).

So, to begin the game simply begin by sowing from the house of your
choice and so on::

  pyAwale> sow E
  South player swon from 'E'
               f    e    d    c    b    a
  North ( 0) [ 4] [ 4] [ 4] [ 5] [ 5] [ 5]
             [ 4] [ 4] [ 4] [ 4] [ 0] [ 5] ( 0) South
               A    B    C    D    E    F
  North player swon from 'a' (in 0.010115s)
               f    e    d    c    b    a
  North ( 0) [ 5] [ 5] [ 5] [ 6] [ 6] [ 0]
             [ 4] [ 4] [ 4] [ 4] [ 0] [ 5] ( 0) South
               A    B    C    D    E    F
  pyAwale>


Pygame User Interface
=====================

Introduction
------------

This panel show up the Terms of Use and current settings
(algorithm/level used).

.. image:: pyawale_intro.jpg

You can choose your algorithm and the associated level by using
respectively ``a`` and ``l`` keys.

Remark: The ``h`` key show/hide a short usage summary.

Then, to start the game, click on the Awale board.

Game panel
----------

Simply click on the house to sow seeds.

Note: Hit ``c`` key (before clicking) for computer begins the game.

.. image:: pyawale_gui.jpg

On the upper left corner you can see your last move, and the move of
the computer.

Remark: When you capture, seeds are stored on the ground on your side.

End game
---------

When the end of the game is reached, or when you quit the game (with
``ESC`` key), this panel compute and show you the final score.

.. image:: pyawale_end.jpg


PS: Use ``RETURN`` key to replay or quit with ``ESC`` key.


.. Awale rules/module
.. include:: awale_module.rest


.. Awale algorithms
.. include:: awale_algos.rest


-- 
MiKael NAVARRO