olinox hace 8 años
padre
commit
c328acc612

BIN
docs/_build/doctrees/API.doctree


BIN
docs/_build/doctrees/CLI Usage.doctree


BIN
docs/_build/doctrees/dice_notation.doctree


BIN
docs/_build/doctrees/environment.pickle


BIN
docs/_build/doctrees/index.doctree


+ 168 - 0
docs/_build/html/API.html

@@ -0,0 +1,168 @@
+
+<!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>&lt;no title&gt; &#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="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">
+            
+  <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>
+</pre></div>
+</div>
+</dd>
+</dl>
+</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>
+<ul class="simple">
+<li><em>pattern.format_string</em></li>
+</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>
+</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>
+      </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>
+
+<div class="relations">
+<h3>Related Topics</h3>
+<ul>
+  <li><a href="index.html">Documentation overview</a><ul>
+  </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/API.md.txt"
+          rel="nofollow">Page source</a>
+    </div>
+
+    
+
+    
+  </body>
+</html>

+ 132 - 0
docs/_build/html/CLI Usage.html

@@ -0,0 +1,132 @@
+
+<!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>&lt;no title&gt; &#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="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">
+            
+  <p># XDice Command-Line</p>
+<p>Run <cite>python roll.py [options] &lt;expr&gt;</cite></p>
+<blockquote>
+<div><dl class="docutils">
+<dt>Usage:</dt>
+<dd>roll [options] &lt;expr&gt;</dd>
+<dt>Options:</dt>
+<dd><table class="first docutils option-list" frame="void" rules="none">
+<col class="option" />
+<col class="description" />
+<tbody valign="top">
+<tr><td class="option-group">
+<kbd><span class="option">-s</span></kbd></td>
+<td>Numeric score only</td></tr>
+</tbody>
+</table>
+<p class="last">-h –help        Displays help message
+–version        Displays current xdice version</p>
+</dd>
+</dl>
+</div></blockquote>
+<p>### Examples</p>
+<ul>
+<li><p class="first">Basic use</p>
+<blockquote>
+<div><p><cite>python roll 1d6+1</cite>
+<cite>&gt;&gt; 2       ([1]+1)</cite></p>
+</div></blockquote>
+</li>
+<li><p class="first">Numeric score only</p>
+<blockquote>
+<div><p><cite>python roll -s 1d6+1</cite>
+<cite>&gt;&gt; 2</cite></p>
+</div></blockquote>
+</li>
+</ul>
+
+
+          </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>
+
+<div class="relations">
+<h3>Related Topics</h3>
+<ul>
+  <li><a href="index.html">Documentation overview</a><ul>
+  </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 Usage.md.txt"
+          rel="nofollow">Page source</a>
+    </div>
+
+    
+
+    
+  </body>
+</html>

+ 112 - 0
docs/_build/html/_sources/API.md.txt

@@ -0,0 +1,112 @@
+# API
+
+#### xdice.compile(pattern_string)
+
+> *Similar to `xdice.Pattern(pattern_string).compile()`*
+
+> Returns a compiled Pattern object.
+
+> Pattern object can then be rolled to obtain a PatternScore object.
+
+#### xdice.roll(pattern_string)
+
+> *Similar to `xdice.Pattern(pattern_string).roll()`*
+
+#### xdice.rolldice(faces, amount=1)
+
+> *Similar to `xdice.Dice(faces, amount).roll()`*
+
+## Dice object
+
+> Set of dice.
+
+#### Dice.__init__(sides, amount=1)
+
+> Instantiate a set of dice.
+
+#### 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.
+> Returns the corresponding Dice object.
+
+## Score object
+
+> 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)
+
+>*`iterable` should only contain integers*
+
+> Score value will be the sum of the list's values.
+
+
+## Pattern object
+
+> 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 object
+
+> 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.score(i)
+
+> Returns the Score object at index i.
+
+#### pattern_score.format()
+
+> Return a formatted string detailing the result of the roll.
+
+> *Eg: '3d6+4' => '[1,5,6]+4'*
+
+

+ 24 - 0
docs/_build/html/_sources/CLI Usage.md.txt

@@ -0,0 +1,24 @@
+# XDice Command-Line
+
+Run `python roll.py [options] <expr>`
+	
+	Usage:
+	    roll [options] <expr>
+	
+	Options:
+	    -s               Numeric score only
+	
+	    -h --help        Displays help message
+	    --version        Displays current xdice version
+	    
+### Examples
+
+* Basic use
+
+	`python roll 1d6+1`
+	`>> 2       ([1]+1)`
+	
+* Numeric score only
+
+	`python roll -s 1d6+1`
+	`>> 2`

+ 73 - 0
docs/_build/html/_sources/dice_notation.md.txt

@@ -0,0 +1,73 @@
+# Dice Notation
+
+*Dice notation* is nearly fully understood by pydice.
+
+## Dice
+
+> Following patterns can be passed to the Dice.parse() class method, and will then return the corresponding Dice object.
+
+**[See Wikipedia for a complete definition.](https://en.wikipedia.org/wiki/Dice_notation)**
+
+#### 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.
+
+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 mean, "roll one 4-sided die."
+> `3d6` would mean, "roll three six-sided dice"
+
+Note: the `D%` notation is read as `D100`
+
+#### Selective results
+
+This pattern can be followed by `Ln` and/or `Hn` expressions.
+'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.
+
+> `3D6L1` will roll three 6-sided dice, and drop the lowest, while `3D6H1` will roll three 6-sided dice, and drop the highest.
+
+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
+
+> Following patterns can be passed to the Pattern.parse() class method.
+
+#### Bases
+
+`AdX` notations can be integrated in complex expressions.
+
+Any mathematical expression is allowed:
+
+	>> 1d10+1d5+1
+	>> 1d20-6
+	>> 1d6*2
+	>> 2d20//4
+	>> 1d6*(1d4**2)
+	
+#### Builtin python functions
+
+Currently, the following python functions are allowed: `abs`, `max`, `min`
+
+#### Repeat pattern
+
+The `Rn(AdX)` notation can be used to repat n times the `AdX` command.
+
+For example, the pattern `R3(2d6+2)` will roll `2d6+2` three times.
+
+## 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`

+ 7 - 25
docs/_build/html/_sources/index.md.txt

@@ -1,14 +1,14 @@
-**xdice**
+# XDice
 
 *xdice* is a lightweight python library for managing dice, scores, and dice-notation patterns.
 
 It allows to easily interpret literal expressions as rolls of dice ('1d6', '3d4+3', '12d6+1d4'...etc.), then manipulate the results.
 
-#### Python Versions
+### Python Versions
 
 DiceRollParser has been tested with python 3.3+
 
-#### Examples:  
+### Examples
 
 	import dice
 
@@ -37,37 +37,19 @@ DiceRollParser has been tested with python 3.3+
 	>> 28		'[5,6]+18'
 
 
-#### CLI
-
-Run `python roll.py [options] <expr>`
-	
-	Usage:
-	    roll [options] <expr>
-	
-	Options:
-	    -s               Numeric score only
-	
-	    -h --help        Displays help message
-	    --version        Displays current xdice version
-
-
-#### CONTRIBUTION
+### Contribution
 
 Any opinion / contribution is welcome, please contact us.
 
-#### TO INSTALL
+### Installation
 
 	pip install xdice
 
-#### License
+### License
 
 *xdice* is under GNU License
 
-#### Author
-
-Olivier Massot, 2017, with *Cro-ki Lab*
-
-#### Tags
+### Tags
 
 	dice roll d20 game random parser dices role board
 	

+ 143 - 0
docs/_build/html/dice_notation.html

@@ -0,0 +1,143 @@
+
+<!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>&lt;no title&gt; &#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="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">
+            
+  <p># Dice Notation</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>
+<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>
+</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>
+<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>
+        </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>
+
+<div class="relations">
+<h3>Related Topics</h3>
+<ul>
+  <li><a href="index.html">Documentation overview</a><ul>
+  </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/dice_notation.md.txt"
+          rel="nofollow">Page source</a>
+    </div>
+
+    
+
+    
+  </body>
+</html>

+ 7 - 30
docs/_build/html/index.html

@@ -38,12 +38,12 @@
         <div class="bodywrapper">
           <div class="body" role="main">
             
-  <p><strong>xdice</strong></p>
+  <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>### Python Versions</p>
 <p>DiceRollParser has been tested with python 3.3+</p>
-<p>#### Examples:</p>
+<p>### Examples</p>
 <blockquote>
 <div><p>import dice</p>
 <p>## Roll simple dices with <strong>rolldice()</strong></p>
@@ -63,37 +63,14 @@
 <p>print( ps, ps.format() )
 &gt;&gt; 28           ‘[5,6]+18’</p>
 </div></blockquote>
-<p>#### CLI</p>
-<p>Run <cite>python roll.py [options] &lt;expr&gt;</cite></p>
-<blockquote>
-<div><dl class="docutils">
-<dt>Usage:</dt>
-<dd>roll [options] &lt;expr&gt;</dd>
-<dt>Options:</dt>
-<dd><table class="first docutils option-list" frame="void" rules="none">
-<col class="option" />
-<col class="description" />
-<tbody valign="top">
-<tr><td class="option-group">
-<kbd><span class="option">-s</span></kbd></td>
-<td>Numeric score only</td></tr>
-</tbody>
-</table>
-<p class="last">-h –help        Displays help message
-–version        Displays current xdice version</p>
-</dd>
-</dl>
-</div></blockquote>
-<p>#### CONTRIBUTION</p>
+<p>### Contribution</p>
 <p>Any opinion / contribution is welcome, please contact us.</p>
-<p>#### TO INSTALL</p>
+<p>### Installation</p>
 <blockquote>
 <div>pip install xdice</div></blockquote>
-<p>#### License</p>
+<p>### License</p>
 <p><em>xdice</em> is under GNU License</p>
-<p>#### Author</p>
-<p>Olivier Massot, 2017, with <em>Cro-ki Lab</em></p>
-<p>#### Tags</p>
+<p>### Tags</p>
 <blockquote>
 <div>dice roll d20 game random parser dices role board</div></blockquote>
 

BIN
docs/_build/html/objects.inv


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 1
docs/_build/html/searchindex.js


+ 42 - 11
docs/dice_notation.md

@@ -1,25 +1,47 @@
 # Dice Notation
 
-*Dice notation* is fully understood by pydice.
+*Dice notation* is nearly fully understood by pydice.
 
-### Dice
+## Dice
+
+> Following patterns can be passed to the Dice.parse() class method, and will then return the corresponding Dice object.
+
+**[See Wikipedia for a complete definition.](https://en.wikipedia.org/wiki/Dice_notation)**
+
+#### 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 (usually omitted if 1).
+* A is the number of dice to be rolled (1 if omitted).
 * X is the number of faces of each die.
 
-If the final number is omitted, it is typically assumed to be a six, but in some contexts, other defaults are used.
+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 mean, "roll one 4-sided die."
 > `3d6` would mean, "roll three six-sided dice"
 
-**[See Wikipedia for a complete definition.](https://en.wikipedia.org/wiki/Dice_notation)**
+Note: the `D%` notation is read as `D100`
+
+#### Selective results
+
+This pattern can be followed by `Ln` and/or `Hn` expressions.
+'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.
 
-### Patterns
+> `3D6L1` will roll three 6-sided dice, and drop the lowest, while `3D6H1` will roll three 6-sided dice, and drop the highest.
 
-`AdX` notations can be integrated in complex expressions: the resulting scores will then behave like integers.
+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
+
+> Following patterns can be passed to the Pattern.parse() class method.
+
+#### Bases
+
+`AdX` notations can be integrated in complex expressions.
 
 Any mathematical expression is allowed:
 
@@ -28,15 +50,24 @@ Any mathematical expression is allowed:
 	>> 1d6*2
 	>> 2d20//4
 	>> 1d6*(1d4**2)
-
-...Etc
 	
-### Builtin python functions
+#### Builtin python functions
 
 Currently, the following python functions are allowed: `abs`, `max`, `min`
 
+#### Repeat pattern
 
+The `Rn(AdX)` notation can be used to repat n times the `AdX` command.
 
+For example, the pattern `R3(2d6+2)` will roll `2d6+2` three times.
 
+## 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`

+ 1 - 2
docs/index.md

@@ -51,5 +51,4 @@ Any opinion / contribution is welcome, please contact us.
 
 ### Tags
 
-	dice roll d20 game random parser dices role board
-	
+	dice roll d20 game random parser dices role board

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio