About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
  • Last update: 5 years ago
  • Total downloads: 87
  • Operating system: Linux, Mac OS X, Win All, BSD, Solaris
  • Publisher: Jonas (4 other programs)
See full specifications

scripts default iconA dice roller for Matlab (Scripts) Publisher's description

Dice to be rolled. XdY, where X and Y are scalars, rolls X

SYNOPSIS: [total, details] = roll(str)

INPUT str: Dice to be rolled. XdY, where X and Y are scalars, rolls X
fair Y-sided dice. Both X and Y are necessary.
If str is empty or omitted, '1d20' is used as default.

ROLL replaces the dice expression(s) by the rolled result, and
then evaluates the string. This makes it possible to use any
function call as input to ROLL as long as the function name
does not contain the signature of a roll (i.e. a number
followed by the letter 'd' followed by a number). In practice,
if you use ROLL for games, you most likely need only + and -.

There is one special function, XdYbZ, that takes the best Z
rolls out of the X attempts. This is useful to generate
character abilities in role-playing games.

OUTPUT total: total of the roll
details: individual rolls (cell array with results for each
dice in the input

REMARKS (1) If no output is requested, results are printed to screen
(2) Thanks to John D'Errico for pointing out that it is possible
to use any function with roll (as long as it takes the
results of dice rolls as input)

EXAMPLES roll 2d6 rolls two 6-sided dice
roll 1d8+1d4-2 rolls a 8-sided dice, a 4-sided dice and subtracts
2 from the result
roll 1d2 rolls a 2-sided dice (i.e. a coin flip)
roll log(2^1d6) takes the natural logarithm of 2 to the power of
the result of the roll of a 6-sided dice.
roll 1+1 throws an error, because there are no dice to roll.

System Requirements:

MATLAB 7.8 (R2009a)
Program Release Status: New Release
Program Install Support: Install and Uninstall

A dice roller for Matlab (Scripts) Tags:

Click on a tag to find related softwares

Is A dice roller for Matlab (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.