Skip to content

brianherbert/dice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dice

Multiple scripts that roll dice using dice notation.

Bash

> sh roll.sh 2d10+4

Lua

> lua roll.lua 2d10+4

Perl

> perl roll.pl 2d10+4

PHP

> php roll.php 2d10+4

R

> Rscript roll.r 2d10+4

Dice Regex

/(?:(\d+)\sX\s)?(\d*)D(\d*)((?:[+/*-]\d+)|(?:[+-][LH]))?/i