Explorar o código

Update docs with mior corrections

olinox %!s(int64=8) %!d(string=hai) anos
pai
achega
7f0d591d6e

BIN=BIN
docs/_build/doctrees/API.doctree


BIN=BIN
docs/_build/doctrees/cli.doctree


BIN=BIN
docs/_build/doctrees/dice_notation.doctree


BIN=BIN
docs/_build/doctrees/environment.pickle


BIN=BIN
docs/_build/doctrees/index.doctree


BIN=BIN
docs/_build/doctrees/introduction.doctree


+ 167 - 68
docs/_build/html/API.html

@@ -5,7 +5,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>&lt;no title&gt; &#8212; xdice 1.0.0 documentation</title>
+    <title>API &#8212; xdice 1.0.0 documentation</title>
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
     <script type="text/javascript">
     <script type="text/javascript">
@@ -23,6 +23,7 @@
     <script type="text/javascript" src="_static/doctools.js"></script>
     <script type="text/javascript" src="_static/doctools.js"></script>
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="search" title="Search" href="search.html" />
+    <link rel="prev" title="Command-Line" href="cli.html" />
    
    
   <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   
   
@@ -38,78 +39,162 @@
         <div class="bodywrapper">
         <div class="bodywrapper">
           <div class="body" role="main">
           <div class="body" role="main">
             
             
-  <p># API</p>
-<p>#### xdice.compile(pattern_string)</p>
-<p>&gt; <em>Similar to `xdice.Pattern(pattern_string).compile()`</em></p>
-<p>&gt; Returns a compiled Pattern object.</p>
-<p>&gt; Pattern object can then be rolled to obtain a PatternScore object.</p>
-<p>#### xdice.roll(pattern_string)</p>
-<p>&gt; <em>Similar to `xdice.Pattern(pattern_string).roll()`</em></p>
-<p>#### xdice.rolldice(faces, amount=1)</p>
-<p>&gt; <em>Similar to `xdice.Dice(faces, amount).roll()`</em></p>
-<p>## Dice object</p>
-<p>&gt; Set of dice.</p>
-<p>#### Dice.__init__(sides, amount=1)</p>
-<p>&gt; Instantiate a set of dice.</p>
-<p>#### dice.roll()</p>
-<p>&gt; Role the dice and return a Score object</p>
-<p>####*[classmethod]* Dice.parse(cls, pattern)</p>
-<p>&gt; Parse a pattern of the form ‘AdX’, where A and X are positive integers.
-&gt; Returns the corresponding Dice object.</p>
-<p>## Score object</p>
-<p>&gt; Score is a subclass of integer, you can then manipulate it as you would do with an integer.</p>
-<dl class="docutils">
-<dt>&gt; It also provides an access to the detailed score with the property ‘detail’.</dt>
-<dd>‘detail’ is the list of the scores obtained by each dice.</dd>
-</dl>
-<p>&gt; Score class can also be used as an iterable, to walk trough the individual scores.</p>
-<blockquote>
-<div><dl class="docutils">
-<dt>eg:</dt>
-<dd><div class="first last highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">Score</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">])</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
-<span class="go">6</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">+</span> <span class="mi">1</span>
-<span class="go">7</span>
-<span class="gp">&gt;&gt;&gt; </span><span class="nb">list</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
-<span class="go">[1,2,3]</span>
+  <div class="section" id="api">
+<h1>API<a class="headerlink" href="#api" title="Permalink to this headline">¶</a></h1>
+<p>Import the <em>xdice</em> library with <cite>import dice</cite></p>
+<div class="section" id="the-dice-module">
+<h2>The dice module<a class="headerlink" href="#the-dice-module" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="dice-compile-pattern-string">
+<h3>dice.compile(pattern_string)<a class="headerlink" href="#dice-compile-pattern-string" title="Permalink to this headline">¶</a></h3>
+<blockquote>
+<div>Similar to <cite>xdice.Pattern(pattern_string).compile()</cite></div></blockquote>
+</div>
+<div class="section" id="dice-roll-pattern-string">
+<h3>dice.roll(pattern_string)<a class="headerlink" href="#dice-roll-pattern-string" title="Permalink to this headline">¶</a></h3>
+<blockquote>
+<div>Similar to <cite>xdice.Pattern(pattern_string).roll()</cite></div></blockquote>
+</div>
+<div class="section" id="dice-rolldice-faces-amount-1-drop-lowest-0-drop-highest-0">
+<h3>dice.rolldice(faces, amount=1, drop_lowest=0, drop_highest=0)<a class="headerlink" href="#dice-rolldice-faces-amount-1-drop-lowest-0-drop-highest-0" title="Permalink to this headline">¶</a></h3>
+<blockquote>
+<div>Similar to <cite>xdice.Dice(faces, amount, drop_lowest, drop_highest).roll()</cite></div></blockquote>
+</div>
+</div>
+<div class="section" id="dice-class">
+<h2>Dice class<a class="headerlink" href="#dice-class" title="Permalink to this headline">¶</a></h2>
+<blockquote>
+<div>Set of dice.</div></blockquote>
+<div class="section" id="dice-init-sides-amount-1-drop-lowest-0-drop-highest-0">
+<h3>Dice.__init__ (sides, amount=1, drop_lowest=0, drop_highest=0)<a class="headerlink" href="#dice-init-sides-amount-1-drop-lowest-0-drop-highest-0" title="Permalink to this headline">¶</a></h3>
+<blockquote>
+<div>Instantiate a set of dice.</div></blockquote>
+</div>
+<div class="section" id="properties">
+<h3>Properties<a class="headerlink" href="#properties" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li><cite>dice.sides</cite>: number of sides of the dice</li>
+<li><cite>dice.amount</cite>: amount of dice to roll</li>
+<li><cite>dice.drop_lowest</cite>: amount of lowest scores to drop</li>
+<li><cite>dice.drop_highest</cite>: amount of highest scores to drop</li>
+<li><cite>dice.name</cite> : Descriptive name of the Dice object</li>
+</ul>
+</div>
+<div class="section" id="dice-roll">
+<h3>dice.roll()<a class="headerlink" href="#dice-roll" title="Permalink to this headline">¶</a></h3>
+<blockquote>
+<div>Role the dice and return a Score object</div></blockquote>
+</div>
+<div class="section" id="classmethod-dice-parse-cls-pattern">
+<h3><em>[classmethod]</em> Dice.parse(cls, pattern)<a class="headerlink" href="#classmethod-dice-parse-cls-pattern" title="Permalink to this headline">¶</a></h3>
+<blockquote>
+<div>Parse a pattern of the form ‘AdX’, where A and X are positive
+integers, then return the corresponding Dice object. Use
+‘AdX[Ln][Hn]’ to drop the n lowest and/or highest dice when rolled.</div></blockquote>
+</div>
+</div>
+<div class="section" id="score-class">
+<h2>Score class<a class="headerlink" href="#score-class" title="Permalink to this headline">¶</a></h2>
+<blockquote>
+<div><p>Score is a subclass of integer, you can then manipulate it as you
+would do with an integer.</p>
+<div class="line-block">
+<div class="line">It also provides an access to the detailed score with the property
+‘detail’.</div>
+<div class="line">‘detail’ is the list of the scores obtained by each dice.</div>
+</div>
+<p>Score class can also be used as an iterable, to walk trough the
+individual scores.</p>
+</div></blockquote>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">eg</span><span class="p">:</span>
+    <span class="o">&gt;&gt;&gt;</span> <span class="n">s</span> <span class="o">=</span> <span class="n">Score</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">])</span>
+    <span class="o">&gt;&gt;&gt;</span> <span class="nb">print</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
+    <span class="mi">6</span>
+    <span class="o">&gt;&gt;&gt;</span> <span class="n">s</span> <span class="o">+</span> <span class="mi">1</span>
+    <span class="mi">7</span>
+    <span class="o">&gt;&gt;&gt;</span> <span class="nb">list</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
+    <span class="p">[</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">]</span>
 </pre></div>
 </pre></div>
 </div>
 </div>
-</dd>
-</dl>
+<div class="section" id="score-new-iterable-dropped-name">
+<h3>Score.__new__(iterable, dropped=[], name=’‘)<a class="headerlink" href="#score-new-iterable-dropped-name" title="Permalink to this headline">¶</a></h3>
+<blockquote>
+<div><p><cite>iterable</cite> should only contain integers</p>
+<p>Score value will be the sum of the list’s values.</p>
 </div></blockquote>
 </div></blockquote>
-<p>#### Score.__new__(iterable)</p>
-<p>&gt;*`iterable` should only contain integers*</p>
-<p>&gt; Score value will be the sum of the list’s values.</p>
-<p>## Pattern object</p>
-<p>&gt; Dice notation pattern.</p>
-<p>#### Pattern.__init__(instr)</p>
-<p>&gt; Instantiate a Pattern object.</p>
-<p>#### pattern.compile()</p>
-<p>&gt; Parse the pattern. Two properties are updated at this time:</p>
+</div>
+<div class="section" id="id1">
+<h3>Properties<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
 <ul class="simple">
 <ul class="simple">
-<li><em>pattern.format_string</em></li>
+<li><cite>score.detail</cite>: similar to list(score), return the list of the individual results</li>
+<li><cite>score.name</cite>: descriptive name of the dice rolled</li>
+<li><cite>score.dropped</cite>: list of the dropped results</li>
 </ul>
 </ul>
-<p>&gt; The ready-to-be-formatted string built from the <cite>instr</cite> argument.</p>
-<p>&gt; <em>Eg: ‘1d6+4+1d4’ =&gt; ‘{0}+4-{1}’</em></p>
-<ul class="simple">
-<li><em>pattern.dices</em></li>
+</div>
+<div class="section" id="score-format-verbose-false">
+<h3>score.format(verbose=False)<a class="headerlink" href="#score-format-verbose-false" title="Permalink to this headline">¶</a></h3>
+<blockquote>
+<div>A formatted string describing the detailed result.</div></blockquote>
+</div>
+</div>
+<div class="section" id="pattern-class">
+<h2>Pattern class<a class="headerlink" href="#pattern-class" title="Permalink to this headline">¶</a></h2>
+<blockquote>
+<div>Dice notation pattern.</div></blockquote>
+<div class="section" id="pattern-init-instr">
+<h3>Pattern.__init__ (instr)<a class="headerlink" href="#pattern-init-instr" title="Permalink to this headline">¶</a></h3>
+<blockquote>
+<div>Instantiate a Pattern object.</div></blockquote>
+</div>
+<div class="section" id="pattern-compile">
+<h3>pattern.compile()<a class="headerlink" href="#pattern-compile" title="Permalink to this headline">¶</a></h3>
+<blockquote>
+<div>Parse the pattern. Two properties are updated at this time:</div></blockquote>
+<ul>
+<li><p class="first"><em>pattern.format_string</em></p>
+<blockquote>
+<div><p>The ready-to-be-formatted string built from the <code class="docutils literal"><span class="pre">instr</span></code> argument.</p>
+<p><em>Eg: ‘1d6+4+1d4’ =&gt; ‘{0}+4-{1}’</em></p>
+</div></blockquote>
+</li>
+<li><p class="first"><em>pattern.dices</em></p>
+<blockquote>
+<div><p>The list of parsed dice.</p>
+<p><em>Eg: ‘1d6+4+1d4’ =&gt; [(Dice; sides=6;amount=1), (Dice;
+sides=4;amount=1)]</em></p>
+</div></blockquote>
+</li>
 </ul>
 </ul>
-<p>&gt; The list of parsed dice.</p>
-<p>&gt; <em>Eg: ‘1d6+4+1d4’ =&gt; [(Dice; sides=6;amount=1), (Dice; sides=4;amount=1)]</em></p>
-<p>#### pattern.roll()</p>
-<p>&gt; Compile the pattern if it has not been yet, then roll the dice.</p>
-<p>&gt; Return a PatternScore object.</p>
-<p>## PatternScore object</p>
-<p>&gt; PatternScore is a subclass of <strong>integer</strong>, you can then manipulate it as you would do with an integer.</p>
-<p>&gt; Moreover, you can get the list of the scores with the score(i) or scores() methods, and retrieve a formatted result with the format() method.</p>
-<p>#### pattern_score.scores()</p>
-<p>&gt; Returns the list of Score objects extracted from the pattern and rolled.</p>
-<p>#### pattern_score.score(i)</p>
-<p>&gt; Returns the Score object at index i.</p>
-<p>#### pattern_score.format()</p>
-<p>&gt; Return a formatted string detailing the result of the roll.</p>
-<p>&gt; <em>Eg: ‘3d6+4’ =&gt; ‘[1,5,6]+4’</em></p>
+</div>
+<div class="section" id="pattern-roll">
+<h3>pattern.roll()<a class="headerlink" href="#pattern-roll" title="Permalink to this headline">¶</a></h3>
+<blockquote>
+<div><p>Compile the pattern if it has not been yet, then roll the dice.</p>
+<p>Return a PatternScore object.</p>
+</div></blockquote>
+</div>
+</div>
+<div class="section" id="patternscore-class">
+<h2>PatternScore class<a class="headerlink" href="#patternscore-class" title="Permalink to this headline">¶</a></h2>
+<blockquote>
+<div><p>PatternScore is a subclass of <strong>integer</strong>, you can then manipulate
+it as you would do with an integer.</p>
+<p>Moreover, you can get the list of the scores with the score(i) or
+scores() methods, and retrieve a formatted result with the format()
+method.</p>
+</div></blockquote>
+<div class="section" id="pattern-score-scores">
+<h3>pattern_score.scores()<a class="headerlink" href="#pattern-score-scores" title="Permalink to this headline">¶</a></h3>
+<blockquote>
+<div>Returns the list of Score objects extracted from the pattern and
+rolled.</div></blockquote>
+</div>
+<div class="section" id="pattern-score-format-verbose-false">
+<h3>pattern_score.format(verbose=False)<a class="headerlink" href="#pattern-score-format-verbose-false" title="Permalink to this headline">¶</a></h3>
+<blockquote>
+<div>A formatted string describing the detailed result.</div></blockquote>
+</div>
+</div>
+</div>
 
 
 
 
           </div>
           </div>
@@ -127,11 +212,25 @@
 
 
 
 
 <h3>Navigation</h3>
 <h3>Navigation</h3>
+<ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
+<li class="toctree-l1"><a class="reference internal" href="dice_notation.html">Dice Notation</a></li>
+<li class="toctree-l1"><a class="reference internal" href="cli.html">Command-Line</a></li>
+<li class="toctree-l1 current"><a class="current reference internal" href="#">API</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="#the-dice-module">The dice module</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#dice-class">Dice class</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#score-class">Score class</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#pattern-class">Pattern class</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#patternscore-class">PatternScore class</a></li>
+</ul>
+</li>
+</ul>
 
 
 <div class="relations">
 <div class="relations">
 <h3>Related Topics</h3>
 <h3>Related Topics</h3>
 <ul>
 <ul>
   <li><a href="index.html">Documentation overview</a><ul>
   <li><a href="index.html">Documentation overview</a><ul>
+      <li>Previous: <a href="cli.html" title="previous chapter">Command-Line</a></li>
   </ul></li>
   </ul></li>
 </ul>
 </ul>
 </div>
 </div>
@@ -157,7 +256,7 @@
       &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
       &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
       
       
       |
       |
-      <a href="_sources/API.md.txt"
+      <a href="_sources/api.rst.txt"
           rel="nofollow">Page source</a>
           rel="nofollow">Page source</a>
     </div>
     </div>
 
 

+ 153 - 0
docs/_build/html/_sources/api.rst.txt

@@ -0,0 +1,153 @@
+API
+===
+
+Import the *xdice* library with `import dice`
+
+The dice module
+---------------
+
+dice.compile(pattern\_string)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+    Similar to `xdice.Pattern(pattern_string).compile()`
+
+dice.roll(pattern\_string)
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+    Similar to `xdice.Pattern(pattern_string).roll()`
+
+dice.rolldice(faces, amount=1, drop\_lowest=0, drop\_highest=0)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+    Similar to `xdice.Dice(faces, amount, drop_lowest, drop_highest).roll()`
+
+Dice class
+----------
+
+    Set of dice.
+
+Dice.__init__ (sides, amount=1, drop\_lowest=0, drop\_highest=0)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+    Instantiate a set of dice.
+
+Properties
+^^^^^^^^^^
+
+-  `dice.sides`: number of sides of the dice
+-  `dice.amount`: amount of dice to roll
+-  `dice.drop_lowest`: amount of lowest scores to drop
+-  `dice.drop_highest`: amount of highest scores to drop
+-  `dice.name` : Descriptive name of the Dice object
+
+dice.roll()
+^^^^^^^^^^^
+
+    Role the dice and return a Score object
+
+*[classmethod]* Dice.parse(cls, pattern)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+    Parse a pattern of the form ‘AdX’, where A and X are positive
+    integers, then return the corresponding Dice object. Use
+    ‘AdX[Ln][Hn]’ to drop the n lowest and/or highest dice when rolled.
+
+
+Score class
+-----------
+
+    Score is a subclass of integer, you can then manipulate it as you
+    would do with an integer.
+
+    | It also provides an access to the detailed score with the property
+      ‘detail’.
+    | ‘detail’ is the list of the scores obtained by each dice.
+
+    Score class can also be used as an iterable, to walk trough the
+    individual scores.
+
+::
+
+    eg:
+        >>> s = Score([1,2,3])
+        >>> print(s)
+        6
+        >>> s + 1
+        7
+        >>> list(s)
+        [1,2,3]
+
+Score.__new__(iterable, dropped=[], name='')
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+    `iterable` should only contain integers
+
+    Score value will be the sum of the list’s values.
+
+Properties
+^^^^^^^^^^
+
+-  `score.detail`: similar to list(score), return the list of the individual results
+-  `score.name`: descriptive name of the dice rolled
+-  `score.dropped`: list of the dropped results
+
+score.format(verbose=False)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+    A formatted string describing the detailed result.
+
+Pattern class
+-------------
+
+    Dice notation pattern.
+
+Pattern.__init__ (instr)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+    Instantiate a Pattern object.
+
+pattern.compile()
+^^^^^^^^^^^^^^^^^
+
+    Parse the pattern. Two properties are updated at this time:
+
+-  *pattern.format\_string*
+
+    The ready-to-be-formatted string built from the ``instr`` argument.
+
+    *Eg: ‘1d6+4+1d4’ => ‘{0}+4-{1}’*
+
+-  *pattern.dices*
+
+    The list of parsed dice.
+
+    *Eg: ‘1d6+4+1d4’ => [(Dice; sides=6;amount=1), (Dice;
+    sides=4;amount=1)]*
+
+pattern.roll()
+^^^^^^^^^^^^^^
+
+    Compile the pattern if it has not been yet, then roll the dice.
+
+    Return a PatternScore object.
+
+PatternScore class
+-------------------
+
+    PatternScore is a subclass of **integer**, you can then manipulate
+    it as you would do with an integer.
+
+    Moreover, you can get the list of the scores with the score(i) or
+    scores() methods, and retrieve a formatted result with the format()
+    method.
+
+pattern\_score.scores()
+^^^^^^^^^^^^^^^^^^^^^^^
+
+    Returns the list of Score objects extracted from the pattern and
+    rolled.
+    
+pattern\_score.format(verbose=False)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+    A formatted string describing the detailed result.

+ 32 - 0
docs/_build/html/_sources/cli.rst.txt

@@ -0,0 +1,32 @@
+Command-Line
+------------
+
+Run ``python roll.py [options] <expr>``
+
+::
+
+    Usage:
+        roll [options] <expr>
+
+    Options:
+        -s               Numeric score only
+        -v               Verbose result
+
+        -h --help        Displays help message
+        --version        Displays current xdice version
+        
+
+-  Basic use
+
+   ``python roll 1d6+1``
+   ``>> 2       ([1]+1)``
+
+-  Numeric score only (-s)
+
+   ``python roll -s 1d6+1``
+   ``>> 2``
+
+-  Verbose (-v)
+
+   ``python roll -v 2*(3D6L1+2D4)+R3(1d4+2)``
+   ``>> (2*(3d6l1(scores:[5, 6], dropped:[3])+2d4(scores:[2, 1]))+(1d4(scores:[4])+2+1d4(scores:[1])+2+1d4(scores:[4])+2))``

+ 106 - 0
docs/_build/html/_sources/dice_notation.rst.txt

@@ -0,0 +1,106 @@
+Dice Notation
+-------------
+
+*Dice notation* is nearly fully understood by pydice.
+
+Case sensitivity
+^^^^^^^^^^^^^^^^
+
+*xdice* is case insensitive.
+
+Dice
+~~~~
+
+    Patterns describes here can be passed to the Dice.parse() class
+    method, and will then return the corresponding Dice object.
+
+`See Wikipedia for a complete definition.`_
+
+Bases
+^^^^^
+
+Die rolls are given in the form AdX. A (amount) and X (sides) are
+variables, separated by the letter “d”, which stands for die or dice.
+
+-  A is the number of dice to be rolled (1 if omitted).
+-  X is the number of faces of each die.
+
+    For example, if a game would call for a roll of d4 or 1d4 this would
+    mean, “roll one 4-sided die.” 3d6 would mean, “roll three
+    six-sided dice”
+
+Default values
+^^^^^^^^^^^^^^
+
+If the A value is omitted, it is assumed to be a 1.
+
+If the X value is omitted, it is assumed to be a 20.
+This behavior can be modified trough the class property Dice.DEFAULT\_SIDES.
+
+D% Notation
+^^^^^^^^^^^
+
+The ``D%`` notation is allowed, and read as ``D100``.
+
+Selective results
+^^^^^^^^^^^^^^^^^
+
+The ``AdX`` pattern can be followed by ``Ln`` and/or ``Hn`` (‘L’ and ‘H’
+respectively stand for lowest and highest).
+
+In this case, the lowest/highest n scores will be discard when the dice
+will be rolled.
+
+> Eg: ``3D6L1`` will roll three 6-sided dice, and drop the lowest, while ``3D6H1`` will roll three 6-sided dice, and drop the highest.
+
+Notes: 
+
+- If no number follow the ‘L’ or ‘H’, it is assumed to be a 1.
+- ‘L’ and ‘H’ can be combined inside a single pattern, but 'L' must precede 'H': ``6D6L1H2``
+
+
+Patterns
+~~~~~~~~
+
+    Patterns describes here can be passed to the Pattern.parse() class
+    method.
+
+``AdX`` notations can be used in more complex expressions.
+
+Any mathematical expression is allowed:
+
+::
+
+    >> 1d10+1d5+1
+    >> 1d20-6
+    >> 1d6*2
+    >> 2d20//4
+    >> 1d6*(1d4**2)
+
+
+Following builtin python functions are also allowed: ``abs``, ``max``,
+``min``. That mean you can parse patterns like ``max(1d6+1, 2d4)``.
+
+
+Repeat
+^^^^^^
+
+The ``Rn(AdX)`` notation can be used to roll n times the ``AdX`` command.
+
+For example, the pattern ``R3(2d6+2)`` will roll ``2d6+2`` three times: ``(2d6+2)+(2d6+2)+(2d6+2)``
+
+
+Examples
+~~~~~~~~
+
+-  ``1d6`` 				> Roll a 6-sided die
+-  ``1d6+3`` 			> Roll a 6-sided die, then add 3
+-  ``2*(1d6+3)`` 		> Roll a 6-sided die, add 3, then multiply by 2
+-  ``3d6L2`` 			> Roll three 6-sided dice, and drop the two lowest.
+-  ``R2(1d6+3)`` 		> Similar to ``1d6+3+1d6+3``
+-  ``1d%`` 				> Similar to ``1d100``
+-  ``d6`` 				> Similar to ``1d6``
+-  ``min(1d6+10,3d6)`` 	> Keep the minimal score between ``1d6+10`` and ``3d6``
+
+.. _See Wikipedia for a complete definition.: https://en.wikipedia.org/wiki/Dice_notation
+

+ 12 - 0
docs/_build/html/_sources/index.rst.txt

@@ -0,0 +1,12 @@
+Welcome to the documentation for xdice
+======================================
+
+Contents:
+
+.. toctree::
+    :maxdepth: 2
+
+    introduction
+    dice_notation
+    cli
+    api

+ 48 - 0
docs/_build/html/_sources/introduction.rst.txt

@@ -0,0 +1,48 @@
+Introduction
+============
+
+
+Presentation
+------------
+
+*xdice* is a dice library for Python that provides the main functionality 
+for managing dice, scores, and dice notation patterns.
+
+DiceRollParser has been tested with python 3.3+.  
+*xdice* is under GNU License
+
+To install:
+
+::
+
+    pip install xdice
+
+What can it do?
+---------------
+
+* Parse most of common dice notations: '1d6+1', 'd20', '3d%', '1d20//2 - 2*(6d6+2)', 'max(1d4+1,1d6)', '3D6L2', 'R3(1d6+1)'...etc.
+* Manipulate Dice, Pattern, and Score as objects.
+* Roll trough command-line or API
+* Understand any mathematical expression
+
+
+Examples
+~~~~~~~~
+
+::
+
+    import dice
+
+    score = dice.roll("2d6+18")
+
+    print(score)
+    >> 28
+    print(score*2)
+    >> 56
+    print(score.format())
+    >> '[5,6]+18'
+
+    score = dice.roll("6D%L2")
+    
+    print(ps, ps.format(verbose=True))
+    >> 315	'6D%L2(scores:[80, 70, 76, 89], dropped:[2, 49])'

+ 135 - 0
docs/_build/html/cli.html

@@ -0,0 +1,135 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>Command-Line &#8212; xdice 1.0.0 documentation</title>
+    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     '1.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true,
+        SOURCELINK_SUFFIX: '.txt'
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="next" title="API" href="api.html" />
+    <link rel="prev" title="Dice Notation" href="dice_notation.html" />
+   
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
+  
+  
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
+
+  </head>
+  <body>
+  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body" role="main">
+            
+  <div class="section" id="command-line">
+<h1>Command-Line<a class="headerlink" href="#command-line" title="Permalink to this headline">¶</a></h1>
+<p>Run <code class="docutils literal"><span class="pre">python</span> <span class="pre">roll.py</span> <span class="pre">[options]</span> <span class="pre">&lt;expr&gt;</span></code></p>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">Usage</span><span class="p">:</span>
+    <span class="n">roll</span> <span class="p">[</span><span class="n">options</span><span class="p">]</span> <span class="o">&lt;</span><span class="n">expr</span><span class="o">&gt;</span>
+
+<span class="n">Options</span><span class="p">:</span>
+    <span class="o">-</span><span class="n">s</span>               <span class="n">Numeric</span> <span class="n">score</span> <span class="n">only</span>
+    <span class="o">-</span><span class="n">v</span>               <span class="n">Verbose</span> <span class="n">result</span>
+
+    <span class="o">-</span><span class="n">h</span> <span class="o">--</span><span class="n">help</span>        <span class="n">Displays</span> <span class="n">help</span> <span class="n">message</span>
+    <span class="o">--</span><span class="n">version</span>        <span class="n">Displays</span> <span class="n">current</span> <span class="n">xdice</span> <span class="n">version</span>
+</pre></div>
+</div>
+<ul>
+<li><p class="first">Basic use</p>
+<p><code class="docutils literal"><span class="pre">python</span> <span class="pre">roll</span> <span class="pre">1d6+1</span></code>
+<code class="docutils literal"><span class="pre">&gt;&gt;</span> <span class="pre">2</span>&#160;&#160;&#160;&#160;&#160;&#160; <span class="pre">([1]+1)</span></code></p>
+</li>
+<li><p class="first">Numeric score only (-s)</p>
+<p><code class="docutils literal"><span class="pre">python</span> <span class="pre">roll</span> <span class="pre">-s</span> <span class="pre">1d6+1</span></code>
+<code class="docutils literal"><span class="pre">&gt;&gt;</span> <span class="pre">2</span></code></p>
+</li>
+<li><p class="first">Verbose (-v)</p>
+<p><code class="docutils literal"><span class="pre">python</span> <span class="pre">roll</span> <span class="pre">-v</span> <span class="pre">2*(3D6L1+2D4)+R3(1d4+2)</span></code>
+<code class="docutils literal"><span class="pre">&gt;&gt;</span> <span class="pre">(2*(3d6l1(scores:[5,</span> <span class="pre">6],</span> <span class="pre">dropped:[3])+2d4(scores:[2,</span> <span class="pre">1]))+(1d4(scores:[4])+2+1d4(scores:[1])+2+1d4(scores:[4])+2))</span></code></p>
+</li>
+</ul>
+</div>
+
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+        <div class="sphinxsidebarwrapper">
+<h1 class="logo"><a href="index.html">xdice</a></h1>
+
+
+
+
+
+
+
+
+<h3>Navigation</h3>
+<ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
+<li class="toctree-l1"><a class="reference internal" href="dice_notation.html">Dice Notation</a></li>
+<li class="toctree-l1 current"><a class="current reference internal" href="#">Command-Line</a></li>
+<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
+</ul>
+
+<div class="relations">
+<h3>Related Topics</h3>
+<ul>
+  <li><a href="index.html">Documentation overview</a><ul>
+      <li>Previous: <a href="dice_notation.html" title="previous chapter">Dice Notation</a></li>
+      <li>Next: <a href="api.html" title="next chapter">API</a></li>
+  </ul></li>
+</ul>
+</div>
+<div id="searchbox" style="display: none" role="search">
+  <h3>Quick search</h3>
+    <form class="search" action="search.html" method="get">
+      <div><input type="text" name="q" /></div>
+      <div><input type="submit" value="Go" /></div>
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="footer">
+      &copy;2017, Olivier Massot.
+      
+      |
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.3</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
+      
+      |
+      <a href="_sources/cli.rst.txt"
+          rel="nofollow">Page source</a>
+    </div>
+
+    
+
+    
+  </body>
+</html>

+ 105 - 45
docs/_build/html/dice_notation.html

@@ -5,7 +5,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>&lt;no title&gt; &#8212; xdice 1.0.0 documentation</title>
+    <title>Dice Notation &#8212; xdice 1.0.0 documentation</title>
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
     <script type="text/javascript">
     <script type="text/javascript">
@@ -23,6 +23,8 @@
     <script type="text/javascript" src="_static/doctools.js"></script>
     <script type="text/javascript" src="_static/doctools.js"></script>
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="search" title="Search" href="search.html" />
+    <link rel="next" title="Command-Line" href="cli.html" />
+    <link rel="prev" title="Introduction" href="introduction.html" />
    
    
   <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   
   
@@ -38,53 +40,95 @@
         <div class="bodywrapper">
         <div class="bodywrapper">
           <div class="body" role="main">
           <div class="body" role="main">
             
             
-  <p># Dice Notation</p>
+  <div class="section" id="dice-notation">
+<h1>Dice Notation<a class="headerlink" href="#dice-notation" title="Permalink to this headline">¶</a></h1>
 <p><em>Dice notation</em> is nearly fully understood by pydice.</p>
 <p><em>Dice notation</em> is nearly fully understood by pydice.</p>
-<p>## Dice</p>
-<p>&gt; Following patterns can be passed to the Dice.parse() class method, and will then return the corresponding Dice object.</p>
-<p><strong>[See Wikipedia for a complete definition.](https://en.wikipedia.org/wiki/Dice_notation)</strong></p>
-<p>#### Bases</p>
-<p>Die rolls are given in the form AdX. A (amount) and X (sides) are variables, separated by the letter “d”, which stands for die or dice.</p>
+<div class="section" id="case-sensitivity">
+<h2>Case sensitivity<a class="headerlink" href="#case-sensitivity" title="Permalink to this headline">¶</a></h2>
+<p><em>xdice</em> is case insensitive.</p>
+<div class="section" id="dice">
+<h3>Dice<a class="headerlink" href="#dice" title="Permalink to this headline">¶</a></h3>
+<blockquote>
+<div>Patterns describes here can be passed to the Dice.parse() class
+method, and will then return the corresponding Dice object.</div></blockquote>
+<p><a class="reference external" href="https://en.wikipedia.org/wiki/Dice_notation">See Wikipedia for a complete definition.</a></p>
+</div>
+</div>
+<div class="section" id="bases">
+<h2>Bases<a class="headerlink" href="#bases" title="Permalink to this headline">¶</a></h2>
+<p>Die rolls are given in the form AdX. A (amount) and X (sides) are
+variables, separated by the letter “d”, which stands for die or dice.</p>
+<ul>
+<li><p class="first">A is the number of dice to be rolled (1 if omitted).</p>
+</li>
+<li><p class="first">X is the number of faces of each die.</p>
+<blockquote>
+<div><p>For example, if a game would call for a roll of d4 or 1d4 this would
+mean, “roll one 4-sided die.” 3d6 would mean, “roll three
+six-sided dice”</p>
+</div></blockquote>
+</li>
+</ul>
+</div>
+<div class="section" id="default-values">
+<h2>Default values<a class="headerlink" href="#default-values" title="Permalink to this headline">¶</a></h2>
+<p>If the A value is omitted, it is assumed to be a 1.</p>
+<p>If the X value is omitted, it is assumed to be a 20.
+This behavior can be modified trough the class property Dice.DEFAULT_SIDES.</p>
+</div>
+<div class="section" id="d-notation">
+<h2>D% Notation<a class="headerlink" href="#d-notation" title="Permalink to this headline">¶</a></h2>
+<p>The <code class="docutils literal"><span class="pre">D%</span></code> notation is allowed, and read as <code class="docutils literal"><span class="pre">D100</span></code>.</p>
+</div>
+<div class="section" id="selective-results">
+<h2>Selective results<a class="headerlink" href="#selective-results" title="Permalink to this headline">¶</a></h2>
+<p>The <code class="docutils literal"><span class="pre">AdX</span></code> pattern can be followed by <code class="docutils literal"><span class="pre">Ln</span></code> and/or <code class="docutils literal"><span class="pre">Hn</span></code> (‘L’ and ‘H’
+respectively stand for lowest and highest).</p>
+<p>In this case, the lowest/highest n scores will be discard when the dice
+will be rolled.</p>
+<p>&gt; Eg: <code class="docutils literal"><span class="pre">3D6L1</span></code> will roll three 6-sided dice, and drop the lowest, while <code class="docutils literal"><span class="pre">3D6H1</span></code> will roll three 6-sided dice, and drop the highest.</p>
+<p>Notes:</p>
 <ul class="simple">
 <ul class="simple">
-<li>A is the number of dice to be rolled (1 if omitted).</li>
-<li>X is the number of faces of each die.</li>
+<li>If no number follow the ‘L’ or ‘H’, it is assumed to be a 1.</li>
+<li>‘L’ and ‘H’ can be combined inside a single pattern, but ‘L’ must precede ‘H’: <code class="docutils literal"><span class="pre">6D6L1H2</span></code></li>
 </ul>
 </ul>
-<p>If the final number is omitted, it is assumed to be a twenty. (This can be changed trough the class property Dice.DEFAULT_SIDES)</p>
-<p>&gt; For example, if a game would call for a roll of d4 or 1d4 this would mean, “roll one 4-sided die.”
-&gt; <cite>3d6</cite> would mean, “roll three six-sided dice”</p>
-<p>Note: the <cite>D%</cite> notation is read as <cite>D100</cite></p>
-<p>#### Selective results</p>
-<p>This pattern can be followed by <cite>Ln</cite> and/or <cite>Hn</cite> expressions.
-‘L’ and ‘H’ respectively stand for lowest and highest.</p>
-<p>In this case, the lowest/highest n scores will be discard when the dice will be rolled.</p>
-<p>&gt; <cite>3D6L1</cite> will roll three 6-sided dice, and drop the lowest, while <cite>3D6H1</cite> will roll three 6-sided dice, and drop the highest.</p>
-<p>If no number follow the ‘L’ or ‘H’, it is assumed to be a 1.
-‘L’ and ‘H’ can be combined inside a single pattern.</p>
-<p>## Patterns</p>
-<p>&gt; Following patterns can be passed to the Pattern.parse() class method.</p>
-<p>#### Bases</p>
-<p><cite>AdX</cite> notations can be integrated in complex expressions.</p>
-<p>Any mathematical expression is allowed:</p>
+<div class="section" id="patterns">
+<h3>Patterns<a class="headerlink" href="#patterns" title="Permalink to this headline">¶</a></h3>
 <blockquote>
 <blockquote>
-<div>&gt;&gt; 1d10+1d5+1
-&gt;&gt; 1d20-6
-&gt;&gt; 1d6*2
-&gt;&gt; 2d20//4
-&gt;&gt; 1d6*(1d4**2)</div></blockquote>
-<p>#### Builtin python functions</p>
-<p>Currently, the following python functions are allowed: <cite>abs</cite>, <cite>max</cite>, <cite>min</cite></p>
-<p>#### Repeat pattern</p>
-<p>The <cite>Rn(AdX)</cite> notation can be used to repat n times the <cite>AdX</cite> command.</p>
-<p>For example, the pattern <cite>R3(2d6+2)</cite> will roll <cite>2d6+2</cite> three times.</p>
-<p>## Examples</p>
-<p><cite>1d6</cite>                                   &gt; Roll a 6-sided die
-<cite>1d6+3</cite>                                 &gt; Roll a 6-sided die, then add 3
-<cite>2*(1d6+3)</cite>                     &gt; Roll a 6-sided die, add 3, then multiply by 2
-<cite>3d6L2</cite>                         &gt; Roll three 6-sided dice, and drop the two lowest.
-<cite>R2(1d6+3)</cite>                     &gt; Similar to <cite>1d6+3+1d6+3</cite>
-<cite>1d%</cite>                                   &gt; Similar to <cite>1d100</cite>
-<cite>d6</cite>                                    &gt; Similar to <cite>1d6</cite>
-<cite>min(1d6+10,3d6)</cite>       &gt; Keep the minimal score between <cite>1d6+10</cite> and <cite>3d6</cite></p>
+<div>Patterns describes here can be passed to the Pattern.parse() class
+method.</div></blockquote>
+<p><code class="docutils literal"><span class="pre">AdX</span></code> notations can be used in more complex expressions.</p>
+<p>Any mathematical expression is allowed:</p>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="o">&gt;&gt;</span> <span class="mi">1</span><span class="n">d10</span><span class="o">+</span><span class="mi">1</span><span class="n">d5</span><span class="o">+</span><span class="mi">1</span>
+<span class="o">&gt;&gt;</span> <span class="mi">1</span><span class="n">d20</span><span class="o">-</span><span class="mi">6</span>
+<span class="o">&gt;&gt;</span> <span class="mi">1</span><span class="n">d6</span><span class="o">*</span><span class="mi">2</span>
+<span class="o">&gt;&gt;</span> <span class="mi">2</span><span class="n">d20</span><span class="o">//</span><span class="mi">4</span>
+<span class="o">&gt;&gt;</span> <span class="mi">1</span><span class="n">d6</span><span class="o">*</span><span class="p">(</span><span class="mi">1</span><span class="n">d4</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span>
+</pre></div>
+</div>
+<p>Following builtin python functions are also allowed: <code class="docutils literal"><span class="pre">abs</span></code>, <code class="docutils literal"><span class="pre">max</span></code>,
+<code class="docutils literal"><span class="pre">min</span></code>. That mean you can parse patterns like <code class="docutils literal"><span class="pre">max(1d6+1,</span> <span class="pre">2d4)</span></code>.</p>
+</div>
+</div>
+<div class="section" id="repeat">
+<h2>Repeat<a class="headerlink" href="#repeat" title="Permalink to this headline">¶</a></h2>
+<p>The <code class="docutils literal"><span class="pre">Rn(AdX)</span></code> notation can be used to roll n times the <code class="docutils literal"><span class="pre">AdX</span></code> command.</p>
+<p>For example, the pattern <code class="docutils literal"><span class="pre">R3(2d6+2)</span></code> will roll <code class="docutils literal"><span class="pre">2d6+2</span></code> three times: <code class="docutils literal"><span class="pre">(2d6+2)+(2d6+2)+(2d6+2)</span></code></p>
+<div class="section" id="examples">
+<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li><code class="docutils literal"><span class="pre">1d6</span></code>                              &gt; Roll a 6-sided die</li>
+<li><code class="docutils literal"><span class="pre">1d6+3</span></code>                    &gt; Roll a 6-sided die, then add 3</li>
+<li><code class="docutils literal"><span class="pre">2*(1d6+3)</span></code>                &gt; Roll a 6-sided die, add 3, then multiply by 2</li>
+<li><code class="docutils literal"><span class="pre">3d6L2</span></code>                    &gt; Roll three 6-sided dice, and drop the two lowest.</li>
+<li><code class="docutils literal"><span class="pre">R2(1d6+3)</span></code>                &gt; Similar to <code class="docutils literal"><span class="pre">1d6+3+1d6+3</span></code></li>
+<li><code class="docutils literal"><span class="pre">1d%</span></code>                              &gt; Similar to <code class="docutils literal"><span class="pre">1d100</span></code></li>
+<li><code class="docutils literal"><span class="pre">d6</span></code>                               &gt; Similar to <code class="docutils literal"><span class="pre">1d6</span></code></li>
+<li><code class="docutils literal"><span class="pre">min(1d6+10,3d6)</span></code>  &gt; Keep the minimal score between <code class="docutils literal"><span class="pre">1d6+10</span></code> and <code class="docutils literal"><span class="pre">3d6</span></code></li>
+</ul>
+</div>
+</div>
+</div>
 
 
 
 
           </div>
           </div>
@@ -102,11 +146,27 @@
 
 
 
 
 <h3>Navigation</h3>
 <h3>Navigation</h3>
+<ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
+<li class="toctree-l1 current"><a class="current reference internal" href="#">Dice Notation</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="#case-sensitivity">Case sensitivity</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#bases">Bases</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#default-values">Default values</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#d-notation">D% Notation</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#selective-results">Selective results</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#repeat">Repeat</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal" href="cli.html">Command-Line</a></li>
+<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
+</ul>
 
 
 <div class="relations">
 <div class="relations">
 <h3>Related Topics</h3>
 <h3>Related Topics</h3>
 <ul>
 <ul>
   <li><a href="index.html">Documentation overview</a><ul>
   <li><a href="index.html">Documentation overview</a><ul>
+      <li>Previous: <a href="introduction.html" title="previous chapter">Introduction</a></li>
+      <li>Next: <a href="cli.html" title="next chapter">Command-Line</a></li>
   </ul></li>
   </ul></li>
 </ul>
 </ul>
 </div>
 </div>
@@ -132,7 +192,7 @@
       &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
       &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
       
       
       |
       |
-      <a href="_sources/dice_notation.md.txt"
+      <a href="_sources/dice_notation.rst.txt"
           rel="nofollow">Page source</a>
           rel="nofollow">Page source</a>
     </div>
     </div>
 
 

+ 6 - 0
docs/_build/html/genindex.html

@@ -62,6 +62,12 @@
 
 
 
 
 <h3>Navigation</h3>
 <h3>Navigation</h3>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
+<li class="toctree-l1"><a class="reference internal" href="dice_notation.html">Dice Notation</a></li>
+<li class="toctree-l1"><a class="reference internal" href="cli.html">Command-Line</a></li>
+<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
+</ul>
 
 
 <div class="relations">
 <div class="relations">
 <h3>Related Topics</h3>
 <h3>Related Topics</h3>

+ 41 - 37
docs/_build/html/index.html

@@ -5,7 +5,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>&lt;no title&gt; &#8212; xdice 1.0.0 documentation</title>
+    <title>Welcome to the documentation for xdice &#8212; xdice 1.0.0 documentation</title>
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
     <script type="text/javascript">
     <script type="text/javascript">
@@ -23,6 +23,7 @@
     <script type="text/javascript" src="_static/doctools.js"></script>
     <script type="text/javascript" src="_static/doctools.js"></script>
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="search" title="Search" href="search.html" />
+    <link rel="next" title="Introduction" href="introduction.html" />
    
    
   <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   <link rel="stylesheet" href="_static/custom.css" type="text/css" />
   
   
@@ -38,41 +39,37 @@
         <div class="bodywrapper">
         <div class="bodywrapper">
           <div class="body" role="main">
           <div class="body" role="main">
             
             
-  <p># XDice</p>
-<p><em>xdice</em> is a lightweight python library for managing dice, scores, and dice-notation patterns.</p>
-<p>It allows to easily interpret literal expressions as rolls of dice (‘1d6’, ‘3d4+3’, ‘12d6+1d4’…etc.), then manipulate the results.</p>
-<p>### Python Versions</p>
-<p>DiceRollParser has been tested with python 3.3+</p>
-<p>### Examples</p>
-<blockquote>
-<div><p>import dice</p>
-<p>## Roll simple dices with <strong>rolldice()</strong></p>
-<p>score = rolldice(6, amount=2)</p>
-<p># manipulates score as an integer</p>
-<p>print( score, score * 2, score == 11 )
-&gt;&gt; 11           22              True</p>
-<p># Iterates over the results</p>
-<dl class="docutils">
-<dt>for result in score:</dt>
-<dd>print(result)</dd>
-</dl>
-<p>&gt;&gt; 5
-&gt;&gt; 6</p>
-<p># Parse patterns with <strong>roll()</strong></p>
-<p>ps = roll(“2d6+18”)</p>
-<p>print( ps, ps.format() )
-&gt;&gt; 28           ‘[5,6]+18’</p>
-</div></blockquote>
-<p>### Contribution</p>
-<p>Any opinion / contribution is welcome, please contact us.</p>
-<p>### Installation</p>
-<blockquote>
-<div>pip install xdice</div></blockquote>
-<p>### License</p>
-<p><em>xdice</em> is under GNU License</p>
-<p>### Tags</p>
-<blockquote>
-<div>dice roll d20 game random parser dices role board</div></blockquote>
+  <div class="section" id="welcome-to-the-documentation-for-xdice">
+<h1>Welcome to the documentation for xdice<a class="headerlink" href="#welcome-to-the-documentation-for-xdice" title="Permalink to this headline">¶</a></h1>
+<p>Contents:</p>
+<div class="toctree-wrapper compound">
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="introduction.html#presentation">Presentation</a></li>
+<li class="toctree-l2"><a class="reference internal" href="introduction.html#what-can-it-do">What can it do?</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal" href="dice_notation.html">Dice Notation</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="dice_notation.html#case-sensitivity">Case sensitivity</a></li>
+<li class="toctree-l2"><a class="reference internal" href="dice_notation.html#bases">Bases</a></li>
+<li class="toctree-l2"><a class="reference internal" href="dice_notation.html#default-values">Default values</a></li>
+<li class="toctree-l2"><a class="reference internal" href="dice_notation.html#d-notation">D% Notation</a></li>
+<li class="toctree-l2"><a class="reference internal" href="dice_notation.html#selective-results">Selective results</a></li>
+<li class="toctree-l2"><a class="reference internal" href="dice_notation.html#repeat">Repeat</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal" href="cli.html">Command-Line</a></li>
+<li class="toctree-l1"><a class="reference internal" href="api.html">API</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="api.html#the-dice-module">The dice module</a></li>
+<li class="toctree-l2"><a class="reference internal" href="api.html#dice-class">Dice class</a></li>
+<li class="toctree-l2"><a class="reference internal" href="api.html#score-class">Score class</a></li>
+<li class="toctree-l2"><a class="reference internal" href="api.html#pattern-class">Pattern class</a></li>
+<li class="toctree-l2"><a class="reference internal" href="api.html#patternscore-class">PatternScore class</a></li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
 
 
 
 
           </div>
           </div>
@@ -90,11 +87,18 @@
 
 
 
 
 <h3>Navigation</h3>
 <h3>Navigation</h3>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
+<li class="toctree-l1"><a class="reference internal" href="dice_notation.html">Dice Notation</a></li>
+<li class="toctree-l1"><a class="reference internal" href="cli.html">Command-Line</a></li>
+<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
+</ul>
 
 
 <div class="relations">
 <div class="relations">
 <h3>Related Topics</h3>
 <h3>Related Topics</h3>
 <ul>
 <ul>
   <li><a href="#">Documentation overview</a><ul>
   <li><a href="#">Documentation overview</a><ul>
+      <li>Next: <a href="introduction.html" title="next chapter">Introduction</a></li>
   </ul></li>
   </ul></li>
 </ul>
 </ul>
 </div>
 </div>
@@ -120,7 +124,7 @@
       &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
       &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
       
       
       |
       |
-      <a href="_sources/index.md.txt"
+      <a href="_sources/index.rst.txt"
           rel="nofollow">Page source</a>
           rel="nofollow">Page source</a>
     </div>
     </div>
 
 

+ 153 - 0
docs/_build/html/introduction.html

@@ -0,0 +1,153 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>Introduction &#8212; xdice 1.0.0 documentation</title>
+    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     '1.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true,
+        SOURCELINK_SUFFIX: '.txt'
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="next" title="Dice Notation" href="dice_notation.html" />
+    <link rel="prev" title="Welcome to the documentation for xdice" href="index.html" />
+   
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
+  
+  
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
+
+  </head>
+  <body>
+  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body" role="main">
+            
+  <div class="section" id="introduction">
+<h1>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h1>
+<div class="section" id="presentation">
+<h2>Presentation<a class="headerlink" href="#presentation" title="Permalink to this headline">¶</a></h2>
+<p><em>xdice</em> is a dice library for Python that provides the main functionality
+for managing dice, scores, and dice notation patterns.</p>
+<p>DiceRollParser has been tested with python 3.3+.
+<em>xdice</em> is under GNU License</p>
+<p>To install:</p>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">xdice</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="what-can-it-do">
+<h2>What can it do?<a class="headerlink" href="#what-can-it-do" title="Permalink to this headline">¶</a></h2>
+<ul class="simple">
+<li>Parse most of common dice notations: ‘1d6+1’, ‘d20’, ‘3d%’, ‘1d20//2 - 2*(6d6+2)’, ‘max(1d4+1,1d6)’, ‘3D6L2’, ‘R3(1d6+1)’…etc.</li>
+<li>Manipulate Dice, Pattern, and Score as objects.</li>
+<li>Roll trough command-line or API</li>
+<li>Understand any mathematical expression</li>
+</ul>
+<div class="section" id="examples">
+<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h3>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">dice</span>
+
+<span class="n">score</span> <span class="o">=</span> <span class="n">dice</span><span class="o">.</span><span class="n">roll</span><span class="p">(</span><span class="s2">&quot;2d6+18&quot;</span><span class="p">)</span>
+
+<span class="nb">print</span><span class="p">(</span><span class="n">score</span><span class="p">)</span>
+<span class="o">&gt;&gt;</span> <span class="mi">28</span>
+<span class="nb">print</span><span class="p">(</span><span class="n">score</span><span class="o">*</span><span class="mi">2</span><span class="p">)</span>
+<span class="o">&gt;&gt;</span> <span class="mi">56</span>
+<span class="nb">print</span><span class="p">(</span><span class="n">score</span><span class="o">.</span><span class="n">format</span><span class="p">())</span>
+<span class="o">&gt;&gt;</span> <span class="s1">&#39;[5,6]+18&#39;</span>
+
+<span class="n">score</span> <span class="o">=</span> <span class="n">dice</span><span class="o">.</span><span class="n">roll</span><span class="p">(</span><span class="s2">&quot;6D%L2&quot;</span><span class="p">)</span>
+
+<span class="nb">print</span><span class="p">(</span><span class="n">ps</span><span class="p">,</span> <span class="n">ps</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">verbose</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
+<span class="o">&gt;&gt;</span> <span class="mi">315</span>      <span class="s1">&#39;6D%L2(scores:[80, 70, 76, 89], dropped:[2, 49])&#39;</span>
+</pre></div>
+</div>
+</div>
+</div>
+</div>
+
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+        <div class="sphinxsidebarwrapper">
+<h1 class="logo"><a href="index.html">xdice</a></h1>
+
+
+
+
+
+
+
+
+<h3>Navigation</h3>
+<ul class="current">
+<li class="toctree-l1 current"><a class="current reference internal" href="#">Introduction</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="#presentation">Presentation</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#what-can-it-do">What can it do?</a></li>
+</ul>
+</li>
+<li class="toctree-l1"><a class="reference internal" href="dice_notation.html">Dice Notation</a></li>
+<li class="toctree-l1"><a class="reference internal" href="cli.html">Command-Line</a></li>
+<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
+</ul>
+
+<div class="relations">
+<h3>Related Topics</h3>
+<ul>
+  <li><a href="index.html">Documentation overview</a><ul>
+      <li>Previous: <a href="index.html" title="previous chapter">Welcome to the documentation for xdice</a></li>
+      <li>Next: <a href="dice_notation.html" title="next chapter">Dice Notation</a></li>
+  </ul></li>
+</ul>
+</div>
+<div id="searchbox" style="display: none" role="search">
+  <h3>Quick search</h3>
+    <form class="search" action="search.html" method="get">
+      <div><input type="text" name="q" /></div>
+      <div><input type="submit" value="Go" /></div>
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="footer">
+      &copy;2017, Olivier Massot.
+      
+      |
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.3</a>
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
+      
+      |
+      <a href="_sources/introduction.rst.txt"
+          rel="nofollow">Page source</a>
+    </div>
+
+    
+
+    
+  </body>
+</html>

+ 2 - 3
docs/_build/html/objects.inv

@@ -2,6 +2,5 @@
 # Project: xdice
 # Project: xdice
 # Version: 1.0.0
 # Version: 1.0.0
 # The remainder of this file is compressed using zlib.
 # The remainder of this file is compressed using zlib.
-xÚm�A
-Â0E÷9Å\ ‚[¡¸
-(¤k‰™¡
¤1#èíµ¦Õ”ºþïÃÔFCÜ ;¨ÖP½ê¤°�â%ÐNíšd[*Áo¸ÀÑ;:G+žc©ÌŠ…ÖRôéñ1‚½Pœ)͸NõÃÆá‚({Æ?ƒ×g5Ù82Þ�Ó‰ìÍus#g>åÞ¼ÿV/=†kª
+xÚmŽA
+Â0E÷9Å\ ‚[w¢›‚ŠàÂ¥ŒÉØ’™Ò¦PoojRÚŠ»äýÿ’��….˜�
۱›:xûk©´[eñš²ƒx�lŠ“eRÆjz°VxY_I<F—ŒTElÙÐð•>É�ÚD“QŽG5×òÛ‹Æ�œOBM½'Îs^ÒÂ0‰O„VL¯W.ùôåL”ógcó.¦ 9ç(8Êk;ÂV×k#±T¾¥üŠ©߇õ

+ 6 - 0
docs/_build/html/search.html

@@ -85,6 +85,12 @@
 
 
 
 
 <h3>Navigation</h3>
 <h3>Navigation</h3>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
+<li class="toctree-l1"><a class="reference internal" href="dice_notation.html">Dice Notation</a></li>
+<li class="toctree-l1"><a class="reference internal" href="cli.html">Command-Line</a></li>
+<li class="toctree-l1"><a class="reference internal" href="api.html">API</a></li>
+</ul>
 
 
 <div class="relations">
 <div class="relations">
 <h3>Related Topics</h3>
 <h3>Related Topics</h3>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
docs/_build/html/searchindex.js


+ 39 - 34
docs/api.rst

@@ -1,27 +1,28 @@
 API
 API
 ===
 ===
 
 
-xdice.compile(pattern\_string)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Import the *xdice* library with `import dice`
 
 
-    Similar to `xdice.Pattern(pattern_string).compile()`
+The dice module
+---------------
 
 
-    Returns a compiled Pattern object.
+dice.compile(pattern\_string)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 
-    Pattern object can then be rolled to obtain a PatternScore object.
+    Similar to `xdice.Pattern(pattern_string).compile()`
 
 
-xdice.roll(pattern\_string)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^
+dice.roll(pattern\_string)
+^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 
     Similar to `xdice.Pattern(pattern_string).roll()`
     Similar to `xdice.Pattern(pattern_string).roll()`
 
 
-xdice.rolldice(faces, amount=1, drop\_lowest=0, drop\_highest=0)
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+dice.rolldice(faces, amount=1, drop\_lowest=0, drop\_highest=0)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 
     Similar to `xdice.Dice(faces, amount, drop_lowest, drop_highest).roll()`
     Similar to `xdice.Dice(faces, amount, drop_lowest, drop_highest).roll()`
 
 
-Dice object
------------
+Dice class
+----------
 
 
     Set of dice.
     Set of dice.
 
 
@@ -30,6 +31,15 @@ Dice.__init__ (sides, amount=1, drop\_lowest=0, drop\_highest=0)
 
 
     Instantiate a set of dice.
     Instantiate a set of dice.
 
 
+Properties
+^^^^^^^^^^
+
+-  `dice.sides`: number of sides of the dice
+-  `dice.amount`: amount of dice to roll
+-  `dice.drop_lowest`: amount of lowest scores to drop
+-  `dice.drop_highest`: amount of highest scores to drop
+-  `dice.name` : Descriptive name of the Dice object
+
 dice.roll()
 dice.roll()
 ^^^^^^^^^^^
 ^^^^^^^^^^^
 
 
@@ -43,17 +53,8 @@ dice.roll()
     ‘AdX[Ln][Hn]’ to drop the n lowest and/or highest dice when rolled.
     ‘AdX[Ln][Hn]’ to drop the n lowest and/or highest dice when rolled.
 
 
 
 
-Properties
-^^^^^^^^^^
-
--  `dice.sides`: number of sides of the dice
--  `dice.amount`: amount of dice to roll
--  `dice.drop_lowest`: amount of lowest scores to drop
--  `dice.drop_highest`: amount of highest scores to drop
--  `dice.name` : Descriptive name of the Dice object
-
-Score object
-------------
+Score class
+-----------
 
 
     Score is a subclass of integer, you can then manipulate it as you
     Score is a subclass of integer, you can then manipulate it as you
     would do with an integer.
     would do with an integer.
@@ -83,21 +84,20 @@ Score.__new__(iterable, dropped=[], name='')
 
 
     Score value will be the sum of the list’s values.
     Score value will be the sum of the list’s values.
 
 
+Properties
+^^^^^^^^^^
+
+-  `score.detail`: similar to list(score), return the list of the individual results
+-  `score.name`: descriptive name of the dice rolled
+-  `score.dropped`: list of the dropped results
+
 score.format(verbose=False)
 score.format(verbose=False)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 
     A formatted string describing the detailed result.
     A formatted string describing the detailed result.
 
 
-Properties
-^^^^^^^^^^
-
--  score.detail: similar to list(score), return the list of the
-   individual results
--  score.name: descriptive name of the dice rolled
--  score.dropped: list of the dropped results
-
-Pattern object
---------------
+Pattern class
+-------------
 
 
     Dice notation pattern.
     Dice notation pattern.
 
 
@@ -131,7 +131,7 @@ pattern.roll()
 
 
     Return a PatternScore object.
     Return a PatternScore object.
 
 
-PatternScore object
+PatternScore class
 -------------------
 -------------------
 
 
     PatternScore is a subclass of **integer**, you can then manipulate
     PatternScore is a subclass of **integer**, you can then manipulate
@@ -145,4 +145,9 @@ pattern\_score.scores()
 ^^^^^^^^^^^^^^^^^^^^^^^
 ^^^^^^^^^^^^^^^^^^^^^^^
 
 
     Returns the list of Score objects extracted from the pattern and
     Returns the list of Score objects extracted from the pattern and
-    rolled.
+    rolled.
+    
+pattern\_score.format(verbose=False)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+    A formatted string describing the detailed result.

+ 4 - 2
docs/cli.rst

@@ -18,11 +18,13 @@ Run ``python roll.py [options] <expr>``
 
 
 -  Basic use
 -  Basic use
 
 
-   ``python roll 1d6+1`` ``>> 2       ([1]+1)``
+   ``python roll 1d6+1``
+   ``>> 2       ([1]+1)``
 
 
 -  Numeric score only (-s)
 -  Numeric score only (-s)
 
 
-   ``python roll -s 1d6+1`` ``>> 2``
+   ``python roll -s 1d6+1``
+   ``>> 2``
 
 
 -  Verbose (-v)
 -  Verbose (-v)
 
 

+ 40 - 27
docs/dice_notation.rst

@@ -3,13 +3,18 @@ Dice Notation
 
 
 *Dice notation* is nearly fully understood by pydice.
 *Dice notation* is nearly fully understood by pydice.
 
 
+Case sensitivity
+^^^^^^^^^^^^^^^^
+
+*xdice* is case insensitive.
+
 Dice
 Dice
 ~~~~
 ~~~~
 
 
     Patterns describes here can be passed to the Dice.parse() class
     Patterns describes here can be passed to the Dice.parse() class
     method, and will then return the corresponding Dice object.
     method, and will then return the corresponding Dice object.
 
 
-**`See Wikipedia for a complete definition.`_**
+`See Wikipedia for a complete definition.`_
 
 
 Bases
 Bases
 ^^^^^
 ^^^^^
@@ -20,14 +25,22 @@ variables, separated by the letter “d”, which stands for die or dice.
 -  A is the number of dice to be rolled (1 if omitted).
 -  A is the number of dice to be rolled (1 if omitted).
 -  X is the number of faces of each die.
 -  X is the number of faces of each die.
 
 
-If the final number is omitted, it is assumed to be a twenty. (This can
-be changed trough the class property Dice.DEFAULT\_SIDES)
-
     For example, if a game would call for a roll of d4 or 1d4 this would
     For example, if a game would call for a roll of d4 or 1d4 this would
-    mean, “roll one 4-sided die.” ``3d6`` would mean, “roll three
+    mean, “roll one 4-sided die.” 3d6 would mean, “roll three
     six-sided dice”
     six-sided dice”
 
 
-Note: the ``D%`` notation is read as ``D100``
+Default values
+^^^^^^^^^^^^^^
+
+If the A value is omitted, it is assumed to be a 1.
+
+If the X value is omitted, it is assumed to be a 20.
+This behavior can be modified trough the class property Dice.DEFAULT\_SIDES.
+
+D% Notation
+^^^^^^^^^^^
+
+The ``D%`` notation is allowed, and read as ``D100``.
 
 
 Selective results
 Selective results
 ^^^^^^^^^^^^^^^^^
 ^^^^^^^^^^^^^^^^^
@@ -38,11 +51,13 @@ respectively stand for lowest and highest).
 In this case, the lowest/highest n scores will be discard when the dice
 In this case, the lowest/highest n scores will be discard when the dice
 will be rolled.
 will be rolled.
 
 
-*Eg: ``3D6L1`` will roll three 6-sided dice, and drop the lowest, while
-``3D6H1`` will roll three 6-sided dice, and drop the highest.*
+> Eg: ``3D6L1`` will roll three 6-sided dice, and drop the lowest, while ``3D6H1`` will roll three 6-sided dice, and drop the highest.
+
+Notes: 
+
+- If no number follow the ‘L’ or ‘H’, it is assumed to be a 1.
+- ‘L’ and ‘H’ can be combined inside a single pattern, but 'L' must precede 'H': ``6D6L1H2``
 
 
-Notes: \* If no number follow the ‘L’ or ‘H’, it is assumed to be a 1.
-\* ‘L’ and ‘H’ can be combined inside a single pattern.
 
 
 Patterns
 Patterns
 ~~~~~~~~
 ~~~~~~~~
@@ -50,7 +65,7 @@ Patterns
     Patterns describes here can be passed to the Pattern.parse() class
     Patterns describes here can be passed to the Pattern.parse() class
     method.
     method.
 
 
-``AdX`` notations can be integrated in complex expressions.
+``AdX`` notations can be used in more complex expressions.
 
 
 Any mathematical expression is allowed:
 Any mathematical expression is allowed:
 
 
@@ -62,32 +77,30 @@ Any mathematical expression is allowed:
     >> 2d20//4
     >> 2d20//4
     >> 1d6*(1d4**2)
     >> 1d6*(1d4**2)
 
 
-Builtin python functions
-^^^^^^^^^^^^^^^^^^^^^^^^
 
 
-Currently, the following python functions are allowed: ``abs``, ``max``,
-``min``
+Following builtin python functions are also allowed: ``abs``, ``max``,
+``min``. That mean you can parse patterns like ``max(1d6+1, 2d4)``.
+
 
 
 Repeat
 Repeat
 ^^^^^^
 ^^^^^^
 
 
-The ``Rn(AdX)`` notation can be used to repat n times the ``AdX``
-command.
+The ``Rn(AdX)`` notation can be used to roll n times the ``AdX`` command.
+
+For example, the pattern ``R3(2d6+2)`` will roll ``2d6+2`` three times: ``(2d6+2)+(2d6+2)+(2d6+2)``
 
 
-For example, the pattern ``R3(2d6+2)`` will roll ``2d6+2`` three times.
 
 
 Examples
 Examples
 ~~~~~~~~
 ~~~~~~~~
 
 
--  ``1d6`` > Roll a 6-sided die
--  ``1d6+3`` > Roll a 6-sided die, then add 3
--  ``2*(1d6+3)`` > Roll a 6-sided die, add 3, then multiply by 2
--  ``3d6L2`` > Roll three 6-sided dice, and drop the two lowest.
--  ``R2(1d6+3)`` > Similar to ``1d6+3+1d6+3``
--  ``1d%`` > Similar to ``1d100``
--  ``d6`` > Similar to ``1d6``
--  ``min(1d6+10,3d6)`` > Keep the minimal score between ``1d6+10`` and
-   ``3d6``
+-  ``1d6`` 				> Roll a 6-sided die
+-  ``1d6+3`` 			> Roll a 6-sided die, then add 3
+-  ``2*(1d6+3)`` 		> Roll a 6-sided die, add 3, then multiply by 2
+-  ``3d6L2`` 			> Roll three 6-sided dice, and drop the two lowest.
+-  ``R2(1d6+3)`` 		> Similar to ``1d6+3+1d6+3``
+-  ``1d%`` 				> Similar to ``1d100``
+-  ``d6`` 				> Similar to ``1d6``
+-  ``min(1d6+10,3d6)`` 	> Keep the minimal score between ``1d6+10`` and ``3d6``
 
 
 .. _See Wikipedia for a complete definition.: https://en.wikipedia.org/wiki/Dice_notation
 .. _See Wikipedia for a complete definition.: https://en.wikipedia.org/wiki/Dice_notation
 
 

+ 2 - 2
docs/introduction.rst

@@ -8,7 +8,7 @@ Presentation
 *xdice* is a dice library for Python that provides the main functionality 
 *xdice* is a dice library for Python that provides the main functionality 
 for managing dice, scores, and dice notation patterns.
 for managing dice, scores, and dice notation patterns.
 
 
-DiceRollParser has been tested with python 3.3+
+DiceRollParser has been tested with python 3.3+.  
 *xdice* is under GNU License
 *xdice* is under GNU License
 
 
 To install:
 To install:
@@ -39,7 +39,7 @@ Examples
     >> 28
     >> 28
     print(score*2)
     print(score*2)
     >> 56
     >> 56
-    print(ps.format())
+    print(score.format())
     >> '[5,6]+18'
     >> '[5,6]+18'
 
 
     score = dice.roll("6D%L2")
     score = dice.roll("6D%L2")

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio