Создал(а) 'ItemRoulette/index.php'
This commit is contained in:
parent
69c3c380bb
commit
900f37312a
21
ItemRoulette/index.php
Normal file
21
ItemRoulette/index.php
Normal 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"
|
||||
}*/
|
Loading…
Reference in New Issue
Block a user