2017 © Pedro Peláez
 

library nuffle

Roll a die with any number of sides.

image

nuffleapp/nuffle

Roll a die with any number of sides.

  • Wednesday, August 31, 2016
  • by zachflower
  • Repository
  • 1 Watchers
  • 2 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

MIT licensed Build Status codecov Gitter Packagist, (*1)

Nuffle, The PHP Library

Nuffle, The PHP Library, is a dice calculator library that provides the functionality to perform complex dice rolls and calculate their result (ex: 5d6 + 1d20 / (1d6 - 2))., (*2)

Installation

Via Composer

Require the library and update via Composer:, (*3)

composer require nuffleapp/nuffle
composer update

Manually

Download the latest release, extract into a directory called nuffle, and include the library at the beginning of your script:, (*4)

include_once('./nuffle/src/Nuffle.php');
use \Nuffle\Nuffle;

Usage

Nuffle is a dice calculator, allowing you to perform complex dice rolls and calculate their result. To do so, simply call the roll() method with your equation:, (*5)

Nuffle::roll('5d6 + 1d20 / (1d6 - 2)')

That method will return an object that looks like the following:, (*6)

{
   "rolls" : [
      {
         "notation" : "5d6",
         "rolls" : [
            2,
            1,
            2,
            4,
            5
         ]
      },
      {
         "notation" : "1d20",
         "rolls" : [
            11
         ]
      },
      {
         "rolls" : [
            4
         ],
         "notation" : "1d6"
      }
   ],
   "equation" : "(2 + 1 + 2 + 4 + 5) + (11) / ((4) - 2)",
   "result" : 19.5,
   "input" : "5d6 + 1d20 / (1d6 - 2)"
}

The object includes the value of each individual dice roll notation, the expanded equation, the equation result, and the original input., (*7)

Contributing

Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development., (*8)

Versioning

For transparency into our release cycle and in striving to maintain backward compatibility, Nuffle is maintained under the Semantic Versioning guidelines. Sometimes we screw up, but we'll adhere to those rules whenever possible., (*9)

See the Releases section of our GitHub project for changelogs for each release version of Nuffle., (*10)

Support

The issue tracker is the preferred channel for bug reports, features requests and submitting pull requests., (*11)

For personal support requests, please use Gitter to get help., (*12)

Code and documentation copyright 2016 nuffleapp. Code released under the MIT license., (*13)

The Versions

31/08 2016

dev-master

9999999-dev

Roll a die with any number of sides.

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

The Development Requires

by Zachary Flower

random dice d20 nuffle

30/08 2016

v1.0.4

1.0.4.0

Roll a die with any number of sides.

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

The Development Requires

by Zachary Flower

random dice d20 nuffle

20/05 2016

v1.0.3

1.0.3.0

Roll a die with any number of sides.

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

The Development Requires

by Zachary Flower

random dice d20 nuffle

19/05 2016

v1.0.2

1.0.2.0

Roll a die with any number of sides.

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

The Development Requires

by Zachary Flower

random dice d20 nuffle

19/05 2016

v1.0.1

1.0.1.0

Roll a die with any number of sides.

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

The Development Requires

by Zachary Flower

random dice d20 nuffle

19/05 2016

v1.0.0

1.0.0.0

Roll a die with any number of sides.

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

The Development Requires

by Zachary Flower

random dice d20 nuffle

13/05 2016

v0.1.1

0.1.1.0

Roll a die with any number of sides.

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

The Development Requires

by Zachary Flower

random dice d20 nuffle

13/05 2016

v0.1.0

0.1.0.0

Roll a die with any number of sides.

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

The Development Requires

by Zachary Flower

random dice d20 nuffle