[ create a new paste ] login | about

Link: http://codepad.org/Ys18Loi4    [ raw code | output | fork ]

PHP, pasted on Dec 16:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
function get_cards()
{
    $cards = array();
    while(count($cards) < 5){
        $card = rand(1,52);
        while(in_array($card, $cards)){
            $card = rand(1,52);   
        }
        $cards[] = $card;
    }
    return $cards;
}

$cards = get_cards();
var_dump(memory_get_peak_usage());


Output:
1
int(51048)


Create a new paste based on this one


Comments: