2017 © Pedro Peláez
 

library dice-roller

RPG rolling dice simulation

image

ethtezahl/dice-roller

RPG rolling dice simulation

  • Thursday, July 13, 2017
  • by Ethtezahl
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

RPG Dice Roller

Concept.

I wanted to code a program which create stats for pre-rolled characters for rpg "Call of Cthulhu". I needed a library that can simulate and give result of a roll of multiple dice (sometimes with a different number of sides). So I created this library, to make these rolls., (*1)

Installation

composer require ethtezahl/dice-roller, (*2)

Basic usage

The code above will simulate the roll of two six-sided die, (*3)

// First: import needed class
use Ethtezahl\DiceRoller\CupFactory;

// Factory allow us to create dice cup.
$factory = new CupFactory();

// We create the cup that will contain the two die:
$cup = $factory->newInstance('2D6');

// Display the result:
echo $cup->roll();

Advanced use: with multiple types of die

Imagine you need to roll three twenty-sided die and one four-sided dice:, (*4)

$cup = $factory->newInstance('3D20+D4');

The Versions

13/07 2017

dev-master

9999999-dev https://github.com/Ethtezahl/dice-roller

RPG rolling dice simulation

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

rpg dice roll

13/07 2017

0.1.3

0.1.3.0 https://github.com/Ethtezahl/dice-roller

RPG rolling dice simulation

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

rpg dice roll

13/07 2017

0.1.2

0.1.2.0 https://github.com/Ethtezahl/dice-roller

RPG rolling dice simulation

  Sources   Download

The Requires

  • php >=7.0

 

The Development Requires

rpg dice roll

13/07 2017

0.1.1

0.1.1.0 https://github.com/Ethtezahl/dice-roller

RPG rolling dice simulation

  Sources   Download

The Requires

  • php >=7.0

 

The Development Requires

rpg dice roll

13/07 2017

0.1.0

0.1.0.0

  Sources   Download

The Requires