What is the fastest way to shuffle an array with numbers without repeating trible times in a row
shuffleX(array(1,2,1,2,1,2),2)
1,1,1,2,2,2 đđŒ
1,1,2,2,1,2 đđŒ
1,2,1,2,1,2 đđŒ
function shuffleX($arr, $max=2){
...
}
$arr=array(1,2,1,1,2,2);
shuffleX($arr,2);
Aucun commentaire:
Enregistrer un commentaire