Создал(а) 'ItemRoulette/index.php'

This commit is contained in:
Ivor Barhansky 2022-02-01 10:33:15 +00:00
parent 69c3c380bb
commit 900f37312a

21
ItemRoulette/index.php Normal file
View File

@ -0,0 +1,21 @@
<?php
require_once 'ItemRoulette.php';
$prize = new ItemRoulette;
$items = ['item-1' => 0.25, 'item-2' => 0.5, 'item-3' => 5, 'item-4' => 4.25333];
$prize->setItems($items);
var_dump($prize->loot());
var_dump($prize->loot(5));
/*string(6) "item-4"
array(5) {
[0]=>
string(6) "item-3"
[1]=>
string(6) "item-4"
[2]=>
string(6) "item-3"
[3]=>
string(6) "item-2"
[4]=>
string(6) "item-3"
}*/