PS the output from my changes i tried above can be viewed here: http://culmstocklights.com/bingo-dev.php as you can see it simply creates extra rows with sequesnced numbers
this is generated byu the following code:
<?php
/*
Random bingo Generator - by Shane Nelson
*/
DEFINE('BR', "<br />\n");
$number_of_cards = 6; // the amount of unique cards to generate. don't make too many!
$columns = array(
range(1,9),
range(10,19),
range(20,29),
range(30,39),
range(40,49),
range(50,59),
range(60,69),
range(70,79),
range(80,89),
range(90,99)
);
$bingo_cards = array();
$card_hashes = array();
$i = 0;
/* GENERATE THE CARDS */
while($i < $number_of_cards) {
$bingo_card = array();
for($j=0; $j<5; $j++) {
$random_keys = array_rand($columns[$j], 9);
$random_values = array_intersect_key($columns[$j], array_flip($random_keys)); // http://stackoverflow.com/a/18047331/3625228
$bingo_card = array_merge($bingo_card, $random_values);
}
// generate a unique hash for this card and compare it to the ones we already have
$card_hash = md5(json_encode($bingo_card)); // or whatever hashing algorithm is preferred
if(!in_array($card_hash, $card_hashes)) {
$bingo_cards[] = $bingo_card;
$card_hashes[] = $card_hash;
$i += 1;
}
if($i > 10000) break; // safety exit
}
/* OUTPUT, if needed (output with monospace font). could be made into an html table. */
foreach($bingo_cards as $card) {
for($k=0; $k<(sizeof($card)/5); $k++) {
echo(str_pad($card[$k], 2, ' ', STR_PAD_LEFT).' | ');
echo($card[$k+5].' | ');
echo($card[$k+10].' | ');
echo($card[$k+15].' | ');
echo($card[$k+20].BR);
if($k < 4) echo(str_repeat('-', 22).BR);
}
echo(BR.BR);
}
?>