2017 © Pedro Peláez
 

library slot-machine

Simple slot machine algorithm

image

unglud/slot-machine

Simple slot machine algorithm

  • Thursday, May 21, 2015
  • by unglued
  • Repository
  • 1 Watchers
  • 4 Stars
  • 49 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

Slot Machine

Simple slot machine algorithm., (*1)

This is a simple tech demo for slot machine algorithm for PHP., (*2)

GitHub release Build Status License Total Downloads, (*3)

Installation

Laravel Image is distributed as a composer package. So you first have to add the package to your composer.json file:, (*4)

{
    "require": {
        "unglud/slot-machine": "@dev"
    }
}

Usage

For start you need create Payout and test it, (*5)

$slot = new SlotMachine([1000,500,300,200,150,100,60,50,40,1]);
$slot->spin();

/*
array:3 [
  0 => "j"
  1 => "i"
  2 => "d"
]
*/

You can test you Payout and see probabilities In result you will see something like this, (*6)

dd($slot->testPayout());
array:11 [
  "a|1" => 0.0476837158203
  "b|3" => 0.643730163574
  "c|5" => 1.78813934326
  "d|7" => 3.27110290527
  "e|9" => 5.21421432495
  "f|11" => 6.34670257568
  "g|13" => 6.28566741943
  "h|15" => 8.04662704468
  "i|17" => 9.37080383301
  "j|47" => 4.95066642761
  "total" => "45.97%"
]

Probabilities generates automatically based on Arithmetic progression, but you can set it manually on second argument:, (*7)

$probs = [
    'a'=>4,
    'b'=>40,
    'c'=>84
];

$slot = new SlotMachine([10,5,1], $probs);

More to come

Later I'll write more about theory., (*8)

License

Laravel Image is released under the MIT Licence. See the bundled LICENSE file for details., (*9)

The Versions

21/05 2015

dev-master

9999999-dev

Simple slot machine algorithm

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar unglued

06/05 2015

v0.2

0.2.0.0

Simple slot machine algorithm

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar unglued

06/05 2015

v0.1

0.1.0.0

Simple slot machine algorithm

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

by Avatar unglued