jeudi 5 mars 2020

shuffle Numbers without triple Repeat in row

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