This Jupyter notebook is designed with a simple GUI that allows the user to simulate the results from a random character attribute rolling method. It uses PyPBE as the backend.
Running this notebook interactively requires you to install Python 3, the latest version of which can be found here:
https://www.python.org/downloads/
Alternatively, if you're having trouble getting these instructions to work, you may want to download the scientific Anaconda package (preferred, but larger size):
https://www.continuum.io/downloads
Once Python 3 is installed, the following Python modules are also required:
The "install.bat" file in this base directory can be used to install these modules automatically using pip (assuming that you are on Windows). Just double-click on the batch file to run it. If you installed Anaconda, most of these are available by default. Otherwise, you can install these modules by opening a command terminal and typing (for each of the six MODULEs above):
pip install MODULE
After those steps are complete, download this notebook to your computer. You can run a Jupyter notebook by typing:
jupyter notebook
in a command terminal, or if you installed Anaconda, open the "Anaconda Navigator" program and click on the "Jupyter" icon. Once the Jupyter notebook interface is open (it should appear in a web browser), navigate to where you downloaded this file, and click on it.
Run the following code by clicking the next "code" cell, then clicking the green arrow ("run") above, and a series of sliders and a button should appear, which allows you to investigate the results from any random character attribute rolling method you desire.
The plots will keep generating every time you click the button (so you can compare results), but you can re-run the cell using the green arrow in order to clear the current plots.
In [2]:
from ipywidgets import *
from pypbe import PBE
import matplotlib.pyplot as plt
%matplotlib inline
system = Dropdown(options=['pf', '3e', '4e', '5e'], value='pf', description='System:')
dice_num = IntSlider(value=3, min=1, max=18, step=1, description='# of Dice')
dice_keep = IntSlider(value=3, min=1, max=18, step=1, description='# Dice to Keep')
dice_type = IntSlider(value=6, min=1, max=18, step=1, description='Dice Type')
dice_add = IntSlider(value=0, min=0, max=18, step=1, description='Add')
att_num = IntSlider(value=6, min=1, max=18, step=1, description='# of Attrs')
att_keep = IntSlider(value=6, min=1, max=18, step=1, description='# Attr to Keep')
arr_num = IntSlider(value=1, min=1, max=18, step=1, description='# of Arrays')
rerolls = IntSlider(value=0, min=0, max=18, step=1, description='Rerolls')
sim = Button(description='Simulate')
def on_button_click(b):
alg = PBE(dice_num.value, dice_type.value, dice_add.value, att_num.value,
arr_num.value, rerolls.value, dice_keep.value, att_keep.value,
system.value)
alg.roll_mc(int(1e5)).plot_histogram()
sim.on_click(on_button_click)
VBox([system, dice_num, dice_keep, dice_type, dice_add, att_num, att_keep, arr_num,
rerolls, sim])
Explanations of each property: