$userdat = $_GET["dat"];
$tray = str_split($userdat); //this will be like a card deck
class slot
{
public $val = 0;
function write(){ //using $val to retrieve $tray values
global $tray;
echo $tray[$this->val];
}
function roll(){//increments to the next value in the $tray
global $traylen;
if ($this->val == $traylen - 1){ //controls max value
$this->val = 0;
} else {
$this->val++;
}
}
}
$slotmac = array();
for ($i=0; $i<count($tray); $i++){
array_push($slotmac, new slot());
}
function fact($n){
if ($n == 0) return 1;
$r = $n;
while ($n>1){
$r *= (--$n);
}
return $r;
}
function perm($k){
global $traylen;
$n = $traylen;
if ($n == $k) return fact($k);
return fact($n)/fact($n - $k);
}
It looks like you're new here. If you want to get involved, click one of these buttons!