Skip to content

Commit

Permalink
release 3.1.0b
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawnDriscoll committed Sep 27, 2020
1 parent ac21310 commit c423b8f
Show file tree
Hide file tree
Showing 32 changed files with 157 additions and 130 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. image:: docs/source/python_classic_2_5_tag.png
:target: https://www.python.org/download/releases/2.5.4/

.. image:: docs/source/release_v3_0_1b_tag.png
.. image:: docs/source/release_v3_1_0b_tag.png
:target: https://readthedocs.org/projects/diceroll/downloads/pdf/latest

.. image:: https://readthedocs.org/projects/diceroll/badge/?version=latest
Expand All @@ -11,10 +11,10 @@

.. figure:: docs/source/diceroll_manual_cover_pdf_art.png

**diceroll 3.0 for Classic Python 2.5**
**diceroll 3.1 for Classic Python 2.5**
=======================================

**diceroll 3.0** is a Classic Python 2.5 module that your game code calls to make dice rolls.
**diceroll 3.1** is a Classic Python 2.5 module that your game code calls to make dice rolls.

Read the **diceroll Operations Manual** at http://diceroll.readthedocs.io

Expand Down
17 changes: 14 additions & 3 deletions diceroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

init() # initialize colorama

__version__ = '3.0'
__release__ = '3.0.1b'
__version__ = '3.1'
__release__ = '3.1.0b'
__author__ = 'Shawn Driscoll <shawndriscoll@hotmail.com>\nshawndriscoll.blogspot.com'

diceroll_log = logging.getLogger('diceroll')
Expand All @@ -50,6 +50,7 @@

number_of_dice = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten']
simple_dice = ['D3', 'D4', 'D6', 'D8', 'D10', 'D12', 'D20', 'D30']
t5_dice = ['1D', '2D', '3D', '4D', '5D', '6D', '7D', '8D', '9D']

def _dierolls(dtype, dcount):
'''
Expand Down Expand Up @@ -85,7 +86,8 @@ def roll(dice):
The dice types to roll are:
'4dF', 'D2', 'D3', 'D4', 'D6', 'D8', 'D09', 'D10',
'D12', 'D20', 'D30', 'D099', 'D100', 'D66', 'DD',
'FLUX', 'GOODFLUX', 'BADFLUX', 'BOON', 'BANE'
'FLUX', 'GOODFLUX', 'BADFLUX', 'BOON', 'BANE',
and also Traveller5's 1D thru 9D rolls
Some examples are:
roll('D6') or roll('1D6') -- roll one 6-sided die
Expand All @@ -101,6 +103,7 @@ def roll(dice):
roll('2DD+3') -- roll (2D6+3) x 10
roll('BOON') -- roll 3D6 and keep the higher two dice
roll('4dF') -- make a FATE roll
roll('4D') -- make a Traveller5 4D roll
roll('info') -- release version of program
An invalid roll will return a 0.
Expand Down Expand Up @@ -254,6 +257,13 @@ def roll(dice):
rolled = die[0] + die[1]
diceroll_log.info('Sorted Bane roll: %d %d %d = %d' % (die[0], die[1], die[2], rolled))
return rolled

# check if T5 dice are being rolled
elif dice in t5_dice:
num_dice = int(dice[0])
rolled = _dierolls(6, num_dice)
diceroll_log.info('%s = %d%s = %d' % (dice, num_dice, 'D6', rolled))
return rolled

# look for DD in the string (for destructive dice rolls)
ichar1 = dice.find('DD')
Expand Down Expand Up @@ -354,6 +364,7 @@ def roll(dice):
print "roll('FLUX') -- a FLUX roll (-5 to 5)"
print "roll('2DD+3') -- roll (2D6+3) x 10"
print "roll('BOON') -- roll 3D6 and keep the higher two dice"
print "roll('4D') -- make a Traveller5 4D roll"
print "roll('4dF') -- make a FATE roll"
print
print "-/+ DMs can be added to rolls:"
Expand Down
Binary file removed diceroll_3.0.1b.zip
Binary file not shown.
Binary file modified docs/build/.doctrees/debugging.doctree
Binary file not shown.
Binary file modified docs/build/.doctrees/diceroll.doctree
Binary file not shown.
Binary file modified docs/build/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/.doctrees/index.doctree
Binary file not shown.
Binary file modified docs/build/.doctrees/introduction.doctree
Binary file not shown.
Binary file modified docs/build/.doctrees/tutorial.doctree
Binary file not shown.
12 changes: 6 additions & 6 deletions docs/build/about_the_author.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"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>About the Author &mdash; diceroll 3.0 Operations Manual</title>
<title>About the Author &mdash; diceroll 3.1 Operations Manual</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.0.1b',
VERSION: '3.1.0b',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html'
};
Expand All @@ -19,7 +19,7 @@
<link rel="contents" title="Global table of contents" href="contents.html" />
<link rel="index" title="Global index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="top" title="diceroll 3.0 Operations Manual" href="index.html" />
<link rel="top" title="diceroll 3.1 Operations Manual" href="index.html" />
<link rel="prev" title="Open Source" href="license.html" />
</head>
<body>
Expand All @@ -35,7 +35,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="license.html" title="Open Source"
accesskey="P">previous</a> |</li>
<li><a href="index.html">diceroll 3.0 Operations Manual</a> &raquo;</li>
<li><a href="index.html">diceroll 3.1 Operations Manual</a> &raquo;</li>
</ul>
</div>
<div class="document">
Expand Down Expand Up @@ -84,12 +84,12 @@ <h3>Navigation</h3>
<li class="right" >
<a href="license.html" title="Open Source"
accesskey="P">previous</a> |</li>
<li><a href="index.html">diceroll 3.0 Operations Manual</a> &raquo;</li>
<li><a href="index.html">diceroll 3.1 Operations Manual</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, SHONNER CORP.
Last updated on Feb 07, 2020.
Last updated on Sep 27, 2020.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down
18 changes: 9 additions & 9 deletions docs/build/debugging.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"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>Debugging diceroll &mdash; diceroll 3.0 Operations Manual</title>
<title>Debugging diceroll &mdash; diceroll 3.1 Operations Manual</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.0.1b',
VERSION: '3.1.0b',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html'
};
Expand All @@ -19,7 +19,7 @@
<link rel="contents" title="Global table of contents" href="contents.html" />
<link rel="index" title="Global index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="top" title="diceroll 3.0 Operations Manual" href="index.html" />
<link rel="top" title="diceroll 3.1 Operations Manual" href="index.html" />
<link rel="next" title="Designer's Notes" href="designers_notes.html" />
<link rel="prev" title="Using roll() in Your Own Code" href="samples.html" />
</head>
Expand All @@ -39,7 +39,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="samples.html" title="Using roll() in Your Own Code"
accesskey="P">previous</a> |</li>
<li><a href="index.html">diceroll 3.0 Operations Manual</a> &raquo;</li>
<li><a href="index.html">diceroll 3.1 Operations Manual</a> &raquo;</li>
</ul>
</div>
<div class="document">
Expand All @@ -53,7 +53,7 @@ <h1><strong>Debugging diceroll</strong><a class="headerlink" href="#debugging-di
<div class="figure">
<img alt="_images/fake_die.png" src="_images/fake_die.png" />
</div>
<p><strong>diceroll 3.0</strong> keeps a log file of any dice rolls made during its last run. You will find <tt class="docutils literal"><span class="pre">diceroll.log</span></tt> in the <tt class="docutils literal"><span class="pre">Logs</span></tt>
<p><strong>diceroll 3.1</strong> keeps a log file of any dice rolls made during its last run. You will find <tt class="docutils literal"><span class="pre">diceroll.log</span></tt> in the <tt class="docutils literal"><span class="pre">Logs</span></tt>
folder it creates if one isn't there already. In the file you will see mentions of dice being rolled. <strong>diceroll</strong> uses
a default logging mode of <tt class="docutils literal"><span class="pre">INFO</span></tt> which isn't that verbose.</p>
<div class="highlight"><pre><span class="n">diceroll_log</span><span class="o">.</span><span class="n">setLevel</span><span class="p">(</span><span class="n">logging</span><span class="o">.</span><span class="n">INFO</span><span class="p">)</span>
Expand All @@ -62,7 +62,7 @@ <h1><strong>Debugging diceroll</strong><a class="headerlink" href="#debugging-di
<blockquote>
<div class="line-block">
<div class="line">...INFO diceroll - Logging started.</div>
<div class="line">...INFO diceroll - roll() v3.0 started, and running...</div>
<div class="line">...INFO diceroll - roll() v3.1 started, and running...</div>
<div class="line">...INFO diceroll - 3D4 = 3D4+0 = 10</div>
</div>
</blockquote>
Expand All @@ -73,7 +73,7 @@ <h1><strong>Debugging diceroll</strong><a class="headerlink" href="#debugging-di
<blockquote>
<div class="line-block">
<div class="line">...INFO diceroll - Logging started.</div>
<div class="line">...INFO diceroll - roll() v3.0 started, and running...</div>
<div class="line">...INFO diceroll - roll() v3.1 started, and running...</div>
<div class="line">...DEBUG diceroll - Asked to roll 3D4:</div>
<div class="line">...DEBUG diceroll - Using three 4-sided dice...</div>
<div class="line">...DEBUG diceroll - Rolled a 4</div>
Expand Down Expand Up @@ -131,12 +131,12 @@ <h3>Navigation</h3>
<li class="right" >
<a href="samples.html" title="Using roll() in Your Own Code"
accesskey="P">previous</a> |</li>
<li><a href="index.html">diceroll 3.0 Operations Manual</a> &raquo;</li>
<li><a href="index.html">diceroll 3.1 Operations Manual</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, SHONNER CORP.
Last updated on Feb 07, 2020.
Last updated on Sep 27, 2020.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down
12 changes: 6 additions & 6 deletions docs/build/designers_notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"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>Designer's Notes &mdash; diceroll 3.0 Operations Manual</title>
<title>Designer's Notes &mdash; diceroll 3.1 Operations Manual</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.0.1b',
VERSION: '3.1.0b',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html'
};
Expand All @@ -19,7 +19,7 @@
<link rel="contents" title="Global table of contents" href="contents.html" />
<link rel="index" title="Global index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="top" title="diceroll 3.0 Operations Manual" href="index.html" />
<link rel="top" title="diceroll 3.1 Operations Manual" href="index.html" />
<link rel="next" title="diceroll Module" href="diceroll.html" />
<link rel="prev" title="Debugging diceroll" href="debugging.html" />
</head>
Expand All @@ -39,7 +39,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="debugging.html" title="Debugging diceroll"
accesskey="P">previous</a> |</li>
<li><a href="index.html">diceroll 3.0 Operations Manual</a> &raquo;</li>
<li><a href="index.html">diceroll 3.1 Operations Manual</a> &raquo;</li>
</ul>
</div>
<div class="document">
Expand Down Expand Up @@ -198,12 +198,12 @@ <h3>Navigation</h3>
<li class="right" >
<a href="debugging.html" title="Debugging diceroll"
accesskey="P">previous</a> |</li>
<li><a href="index.html">diceroll 3.0 Operations Manual</a> &raquo;</li>
<li><a href="index.html">diceroll 3.1 Operations Manual</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, SHONNER CORP.
Last updated on Feb 07, 2020.
Last updated on Sep 27, 2020.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down
15 changes: 8 additions & 7 deletions docs/build/diceroll.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"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>diceroll Module &mdash; diceroll 3.0 Operations Manual</title>
<title>diceroll Module &mdash; diceroll 3.1 Operations Manual</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.0.1b',
VERSION: '3.1.0b',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html'
};
Expand All @@ -19,7 +19,7 @@
<link rel="contents" title="Global table of contents" href="contents.html" />
<link rel="index" title="Global index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="top" title="diceroll 3.0 Operations Manual" href="index.html" />
<link rel="top" title="diceroll 3.1 Operations Manual" href="index.html" />
<link rel="next" title="Glossary" href="glossary.html" />
<link rel="prev" title="Designer's Notes" href="designers_notes.html" />
</head>
Expand All @@ -39,7 +39,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="designers_notes.html" title="Designer's Notes"
accesskey="P">previous</a> |</li>
<li><a href="index.html">diceroll 3.0 Operations Manual</a> &raquo;</li>
<li><a href="index.html">diceroll 3.1 Operations Manual</a> &raquo;</li>
</ul>
</div>
<div class="document">
Expand All @@ -66,7 +66,8 @@ <h1><strong>diceroll Module</strong><a class="headerlink" href="#module-diceroll
<div class="line"><em>dice_roll_modifier</em> must include a '+' or '-' with its value.</div>
<div class="line"><br /></div>
<div class="line">Note that both <em>number_of_dice</em> and <em>dice_roll_modifier</em> are optional, and may not even be</div>
<div class="line">used by some <em>dice_type</em> rolls.</div>
<div class="line">used by some <em>dice_type</em> rolls. Traveller5 rolls will not work with <em>dice_roll_modifier</em></div>
<div class="line">at this time.</div>
</div>
</dd></dl>

Expand Down Expand Up @@ -108,12 +109,12 @@ <h3>Navigation</h3>
<li class="right" >
<a href="designers_notes.html" title="Designer's Notes"
accesskey="P">previous</a> |</li>
<li><a href="index.html">diceroll 3.0 Operations Manual</a> &raquo;</li>
<li><a href="index.html">diceroll 3.1 Operations Manual</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, SHONNER CORP.
Last updated on Feb 07, 2020.
Last updated on Sep 27, 2020.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down
12 changes: 6 additions & 6 deletions docs/build/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"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>Index &mdash; diceroll 3.0 Operations Manual</title>
<title>Index &mdash; diceroll 3.1 Operations Manual</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '3.0.1b',
VERSION: '3.1.0b',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '.html'
};
Expand All @@ -19,7 +19,7 @@
<link rel="contents" title="Global table of contents" href="contents.html" />
<link rel="index" title="Global index" href="" />
<link rel="search" title="Search" href="search.html" />
<link rel="top" title="diceroll 3.0 Operations Manual" href="index.html" />
<link rel="top" title="diceroll 3.1 Operations Manual" href="index.html" />
</head>
<body>
<div class="related">
Expand All @@ -31,7 +31,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="modindex.html" title="Global Module Index"
accesskey="M">modules</a> |</li>
<li><a href="index.html">diceroll 3.0 Operations Manual</a> &raquo;</li>
<li><a href="index.html">diceroll 3.1 Operations Manual</a> &raquo;</li>
</ul>
</div>
<div class="document">
Expand Down Expand Up @@ -94,12 +94,12 @@ <h3>Navigation</h3>
<li class="right" >
<a href="modindex.html" title="Global Module Index"
accesskey="M">modules</a> |</li>
<li><a href="index.html">diceroll 3.0 Operations Manual</a> &raquo;</li>
<li><a href="index.html">diceroll 3.1 Operations Manual</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, SHONNER CORP.
Last updated on Feb 07, 2020.
Last updated on Sep 27, 2020.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
Expand Down

0 comments on commit c423b8f

Please sign in to comment.