PHPackages                             unglud/slot-machine - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. unglud/slot-machine

AbandonedLibrary[Utility &amp; Helpers](/categories/utility)

unglud/slot-machine
===================

Simple slot machine algorithm

v0.2(11y ago)14975[1 issues](https://github.com/unglud/slot-machine/issues)MITPHPPHP &gt;=5.3.0

Since May 6Pushed 11y ago2 watchersCompare

[ Source](https://github.com/unglud/slot-machine)[ Packagist](https://packagist.org/packages/unglud/slot-machine)[ RSS](/packages/unglud-slot-machine/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Slot Machine
============

[](#slot-machine)

Simple slot machine algorithm.

This is a simple tech demo for slot machine algorithm for PHP.

[![GitHub release](https://camo.githubusercontent.com/fac303b8a3cb392aac21ffb5972ce71bb97fa621688f5705ad76a658c9734bd4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f756e676c75642f736c6f742d6d616368696e652e737667)](https://github.com/unglud/slot-machine/releases)[![Build Status](https://camo.githubusercontent.com/4658ae25c44237a0c75995838e81d987f92200d276109d71a07d1abe03fdb1ad/68747470733a2f2f7472617669732d63692e6f72672f756e676c75642f736c6f742d6d616368696e652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/unglud/slot-machine)[![License](https://camo.githubusercontent.com/0c87b33c780539b04b0e1e34f5a08a9476eb84fd947c308e2fbcc42bc977e8ed/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f756e676c75642f736c6f742d6d616368696e652e737667)](https://github.com/unglud/slot-machine/blob/master/LICENSE)[![Total Downloads](https://camo.githubusercontent.com/7ae6620fa25ba94ca7e98cd2595ce3e0b414ffc0c22b0da0b747de99c06cd819/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f756e676c75642f736c6f742d6d616368696e652e737667)](https://packagist.org/packages/unglud/slot-machine)

Installation
------------

[](#installation)

Laravel Image is distributed as a composer package. So you first have to add the package to your `composer.json` file:

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

```

Usage
-----

[](#usage)

For start you need create Payout and test it

```
$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

```
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:

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

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

```

More to come
------------

[](#more-to-come)

Later I'll write more about theory.

License
-------

[](#license)

Laravel Image is released under the MIT Licence. See the bundled LICENSE file for details.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

4030d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b85dea7921dfab50a27316ef0644ec31206302e9cb6c08557802ac4e7ea1632?d=identicon)[unglued](/maintainers/unglued)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/unglud-slot-machine/health.svg)

```
[![Health](https://phpackages.com/badges/unglud-slot-machine/health.svg)](https://phpackages.com/packages/unglud-slot-machine)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
