我正在尝试制作宾果票(Housie)发电机,但我遇到了一些问题。
通常,每行包含沿行排列的五个数字和四个空格。数据按列(1-9,10-19,20-29,30-39,40-49,50-59,60-69,70-79和80-90)分配。我的发电机看起来像这样:
如您所见,我无法获得每行5个数字。我的代码如下(我正在使用RandomPlus类):
package com.demstra.Ticket {
import flash.display.MovieClip;
public class Ticket extends MovieClip {
private var startNumColumn_1:Number = 1;
private var endNumColumn_1:Number = 9;
private var startNumColumn_2:Number = 10;
private var endNumColumn_2:Number = 19;
private var startNumColumn_3:Number = 20;
private var endNumColumn_3:Number = 29;
private var startNumColumn_4:Number = 30;
private var endNumColumn_4:Number = 39;
private var startNumColumn_5:Number = 40;
private var endNumColumn_5:Number = 49;
private var startNumColumn_6:Number = 50;
private var endNumColumn_6:Number = 59;
private var startNumColumn_7:Number = 60;
private var endNumColumn_7:Number = 69;
private var startNumColumn_8:Number = 70;
private var endNumColumn_8:Number = 79;
private var startNumColumn_9:Number = 80;
private var endNumColumn_9:Number = 90;
private var rp1:RandomPlus = new RandomPlus(startNumColumn_1, endNumColumn_1);
private var rp2:RandomPlus = new RandomPlus(startNumColumn_2, endNumColumn_2);
private var rp3:RandomPlus = new RandomPlus(startNumColumn_3, endNumColumn_3);
private var rp4:RandomPlus = new RandomPlus(startNumColumn_4, endNumColumn_4);
private var rp5:RandomPlus = new RandomPlus(startNumColumn_5, endNumColumn_5);
private var rp6:RandomPlus = new RandomPlus(startNumColumn_6, endNumColumn_6);
private var rp7:RandomPlus = new RandomPlus(startNumColumn_7, endNumColumn_7);
private var rp8:RandomPlus = new RandomPlus(startNumColumn_8, endNumColumn_8);
private var rp9:RandomPlus = new RandomPlus(startNumColumn_9, endNumColumn_9);
private var column_1:Array = new Array
(rp1.getNum(), rp1.getNum(), rp1.getNum(), rp1.getNum(), rp1.getNum(), rp1.getNum(), rp1.getNum(), rp1.getNum(), rp1.getNum(),
"", "", "", "", "", "", "", "", "");
private var column_2:Array = new Array
(rp2.getNum(), rp2.getNum(), rp2.getNum(), rp2.getNum(), rp2.getNum(), rp2.getNum(), rp2.getNum(), rp2.getNum(), rp2.getNum(), rp2.getNum(),
"", "", "", "", "", "", "", "");
private var column_3:Array = new Array
(rp3.getNum(), rp3.getNum(), rp3.getNum(), rp3.getNum(), rp3.getNum(), rp3.getNum(), rp3.getNum(), rp3.getNum(), rp3.getNum(), rp3.getNum(),
"", "", "", "", "", "", "", "");
private var column_4:Array = new Array
(rp4.getNum(), rp4.getNum(), rp4.getNum(), rp4.getNum(), rp4.getNum(), rp4.getNum(), rp4.getNum(), rp4.getNum(), rp4.getNum(), rp4.getNum(),
"", "", "", "", "", "", "", "");
private var column_5:Array = new Array
(rp5.getNum(), rp5.getNum(), rp5.getNum(), rp5.getNum(), rp5.getNum(), rp5.getNum(), rp5.getNum(), rp5.getNum(), rp5.getNum(), rp5.getNum(),
"", "", "", "", "", "", "", "");
private var column_6:Array = new Array
(rp6.getNum(), rp6.getNum(), rp6.getNum(), rp6.getNum(), rp6.getNum(), rp6.getNum(), rp6.getNum(), rp6.getNum(), rp6.getNum(), rp6.getNum(),
"", "", "", "", "", "", "", "");
private var column_7:Array = new Array
(rp7.getNum(), rp7.getNum(), rp7.getNum(), rp7.getNum(), rp7.getNum(), rp7.getNum(), rp7.getNum(), rp7.getNum(), rp7.getNum(), rp7.getNum(),
"", "", "", "", "", "", "", "");
private var column_8:Array = new Array
(rp8.getNum(), rp8.getNum(), rp8.getNum(), rp8.getNum(), rp8.getNum(), rp8.getNum(), rp8.getNum(), rp8.getNum(), rp8.getNum(), rp8.getNum(),
"", "", "", "", "", "", "", "");
private var column_9:Array = new Array
(rp9.getNum(), rp9.getNum(), rp9.getNum(), rp9.getNum(), rp9.getNum(), rp9.getNum(), rp9.getNum(), rp9.getNum(), rp9.getNum(), rp9.getNum(), rp9.getNum(),
"", "", "", "", "", "", "");
private var c1:Array = column_1.sort(shuffle);
private var c2:Array = column_2.sort(shuffle);
private var c3:Array = column_3.sort(shuffle);
private var c4:Array = column_4.sort(shuffle);
private var c5:Array = column_5.sort(shuffle);
private var c6:Array = column_6.sort(shuffle);
private var c7:Array = column_7.sort(shuffle);
private var c8:Array = column_8.sort(shuffle);
private var c9:Array = column_9.sort(shuffle);
private function shuffle(a, b):Number {
var num:Number = Math.round(Math.random() * 2) - 2;
return num;
}
private function populateBoxes():void {
variant1_1_1.txt.text = c1[0];
variant1_2_1.txt.text = c1[1];
variant1_3_1.txt.text = c1[2];
variant2_1_1.txt.text = c1[3];
variant2_2_1.txt.text = c1[4];
variant2_3_1.txt.text = c1[5];
variant3_1_1.txt.text = c1[6];
variant3_2_1.txt.text = c1[7];
variant3_3_1.txt.text = c1[8];
variant4_1_1.txt.text = c1[9];
variant4_2_1.txt.text = c1[10];
variant4_3_1.txt.text = c1[11];
variant5_1_1.txt.text = c1[12];
variant5_2_1.txt.text = c1[13];
variant5_3_1.txt.text = c1[14];
variant6_1_1.txt.text = c1[15];
variant6_2_1.txt.text = c1[16];
variant6_3_1.txt.text = c1[17];
//-----------------------------
variant1_1_2.txt.text = c2[0];
variant1_2_2.txt.text = c2[1];
variant1_3_2.txt.text = c2[2];
variant2_1_2.txt.text = c2[3];
variant2_2_2.txt.text = c2[4];
variant2_3_2.txt.text = c2[5];
variant3_1_2.txt.text = c2[6];
variant3_2_2.txt.text = c2[7];
variant3_3_2.txt.text = c2[8];
variant4_1_2.txt.text = c2[9];
variant4_2_2.txt.text = c2[10];
variant4_3_2.txt.text = c2[11];
variant5_1_2.txt.text = c2[12];
variant5_2_2.txt.text = c2[13];
variant5_3_2.txt.text = c2[14];
variant6_1_2.txt.text = c2[15];
variant6_2_2.txt.text = c2[16];
variant6_3_2.txt.text = c2[17];
//-------------------------------
variant1_1_3.txt.text = c3[0];
variant1_2_3.txt.text = c3[1];
variant1_3_3.txt.text = c3[2];
variant2_1_3.txt.text = c3[3];
variant2_2_3.txt.text = c3[4];
variant2_3_3.txt.text = c3[5];
variant3_1_3.txt.text = c3[6];
variant3_2_3.txt.text = c3[7];
variant3_3_3.txt.text = c3[8];
variant4_1_3.txt.text = c3[9];
variant4_2_3.txt.text = c3[10];
variant4_3_3.txt.text = c3[11];
variant5_1_3.txt.text = c3[12];
variant5_2_3.txt.text = c3[13];
variant5_3_3.txt.text = c3[14];
variant6_1_3.txt.text = c3[15];
variant6_2_3.txt.text = c3[16];
variant6_3_3.txt.text = c3[17];
//------------------------------
variant1_1_4.txt.text = c4[0];
variant1_2_4.txt.text = c4[1];
variant1_3_4.txt.text = c4[2];
variant2_1_4.txt.text = c4[3];
variant2_2_4.txt.text = c4[4];
variant2_3_4.txt.text = c4[5];
variant3_1_4.txt.text = c4[6];
variant3_2_4.txt.text = c4[7];
variant3_3_4.txt.text = c4[8];
variant4_1_4.txt.text = c4[9];
variant4_2_4.txt.text = c4[10];
variant4_3_4.txt.text = c4[11];
variant5_1_4.txt.text = c4[12];
variant5_2_4.txt.text = c4[13];
variant5_3_4.txt.text = c4[14];
variant6_1_4.txt.text = c4[15];
variant6_2_4.txt.text = c4[16];
variant6_3_4.txt.text = c4[17];
//------------------------------
variant1_1_5.txt.text = c5[0];
variant1_2_5.txt.text = c5[1];
variant1_3_5.txt.text = c5[2];
variant2_1_5.txt.text = c5[3];
variant2_2_5.txt.text = c5[4];
variant2_3_5.txt.text = c5[5];
variant3_1_5.txt.text = c5[6];
variant3_2_5.txt.text = c5[7];
variant3_3_5.txt.text = c5[8];
variant4_1_5.txt.text = c5[9];
variant4_2_5.txt.text = c5[10];
variant4_3_5.txt.text = c5[11];
variant5_1_5.txt.text = c5[12];
variant5_2_5.txt.text = c5[13];
variant5_3_5.txt.text = c5[14];
variant6_1_5.txt.text = c5[15];
variant6_2_5.txt.text = c5[16];
variant6_3_5.txt.text = c5[17];
//------------------------------
variant1_1_6.txt.text = c6[0];
variant1_2_6.txt.text = c6[1];
variant1_3_6.txt.text = c6[2];
variant2_1_6.txt.text = c6[3];
variant2_2_6.txt.text = c6[4];
variant2_3_6.txt.text = c6[5];
variant3_1_6.txt.text = c6[6];
variant3_2_6.txt.text = c6[7];
variant3_3_6.txt.text = c6[8];
variant4_1_6.txt.text = c6[9];
variant4_2_6.txt.text = c6[10];
variant4_3_6.txt.text = c6[11];
variant5_1_6.txt.text = c6[12];
variant5_2_6.txt.text = c6[13];
variant5_3_6.txt.text = c6[14];
variant6_1_6.txt.text = c6[15];
variant6_2_6.txt.text = c6[16];
variant6_3_6.txt.text = c6[17];
//------------------------------
variant1_1_7.txt.text = c7[0];
variant1_2_7.txt.text = c7[1];
variant1_3_7.txt.text = c7[2];
variant2_1_7.txt.text = c7[3];
variant2_2_7.txt.text = c7[4];
variant2_3_7.txt.text = c7[5];
variant3_1_7.txt.text = c7[6];
variant3_2_7.txt.text = c7[7];
variant3_3_7.txt.text = c7[8];
variant4_1_7.txt.text = c7[9];
variant4_2_7.txt.text = c7[10];
variant4_3_7.txt.text = c7[11];
variant5_1_7.txt.text = c7[12];
variant5_2_7.txt.text = c7[13];
variant5_3_7.txt.text = c7[14];
variant6_1_7.txt.text = c7[15];
variant6_2_7.txt.text = c7[16];
variant6_3_7.txt.text = c7[17];
//------------------------------
variant1_1_8.txt.text = c8[0];
variant1_2_8.txt.text = c8[1];
variant1_3_8.txt.text = c8[2];
variant2_1_8.txt.text = c8[3];
variant2_2_8.txt.text = c8[4];
variant2_3_8.txt.text = c8[5];
variant3_1_8.txt.text = c8[6];
variant3_2_8.txt.text = c8[7];
variant3_3_8.txt.text = c8[8];
variant4_1_8.txt.text = c8[9];
variant4_2_8.txt.text = c8[10];
variant4_3_8.txt.text = c8[11];
variant5_1_8.txt.text = c8[12];
variant5_2_8.txt.text = c8[13];
variant5_3_8.txt.text = c8[14];
variant6_1_8.txt.text = c8[15];
variant6_2_8.txt.text = c8[16];
variant6_3_8.txt.text = c8[17];
//------------------------------
variant1_1_9.txt.text = c9[0];
variant1_2_9.txt.text = c9[1];
variant1_3_9.txt.text = c9[2];
variant2_1_9.txt.text = c9[3];
variant2_2_9.txt.text = c9[4];
variant2_3_9.txt.text = c9[5];
variant3_1_9.txt.text = c9[6];
variant3_2_9.txt.text = c9[7];
variant3_3_9.txt.text = c9[8];
variant4_1_9.txt.text = c9[9];
variant4_2_9.txt.text = c9[10];
variant4_3_9.txt.text = c9[11];
variant5_1_9.txt.text = c9[12];
variant5_2_9.txt.text = c9[13];
variant5_3_9.txt.text = c9[14];
variant6_1_9.txt.text = c9[15];
variant6_2_9.txt.text = c9[16];
variant6_3_9.txt.text = c9[17];
}
public function Ticket():void {
populateBoxes();
externalizeNumbers();
}
public function externalizeNumbers(): void {
var variant_1:Array = new Array(variant1_1_1.txt.text, variant1_1_2.txt.text, variant1_1_3.txt.text, variant1_1_4.txt.text, variant1_1_5.txt.text, variant1_1_6.txt.text, variant1_1_7.txt.text, variant1_1_8.txt.text, variant1_1_9.txt.text,
variant1_2_1.txt.text, variant1_2_2.txt.text, variant1_2_3.txt.text, variant1_2_4.txt.text, variant1_2_5.txt.text, variant1_2_6.txt.text, variant1_2_7.txt.text, variant1_2_8.txt.text, variant1_2_9.txt.text,
variant1_3_1.txt.text, variant1_3_2.txt.text, variant1_3_3.txt.text, variant1_3_4.txt.text, variant1_3_5.txt.text, variant1_3_6.txt.text, variant1_3_7.txt.text, variant1_3_8.txt.text, variant1_3_9.txt.text);
var variant_2:Array = new Array(variant2_1_1.txt.text, variant2_1_2.txt.text, variant2_1_3.txt.text, variant2_1_4.txt.text, variant2_1_5.txt.text, variant2_1_6.txt.text, variant2_1_7.txt.text, variant2_1_8.txt.text, variant2_1_9.txt.text,
variant2_2_1.txt.text, variant2_2_2.txt.text, variant2_2_3.txt.text, variant2_2_4.txt.text, variant2_2_5.txt.text, variant2_2_6.txt.text, variant2_2_7.txt.text, variant2_2_8.txt.text, variant2_2_9.txt.text,
variant2_3_1.txt.text, variant2_3_2.txt.text, variant2_3_3.txt.text, variant2_3_4.txt.text, variant2_3_5.txt.text, variant2_3_6.txt.text, variant2_3_7.txt.text, variant2_3_8.txt.text, variant2_3_9.txt.text);
var variant_3:Array = new Array(variant3_1_1.txt.text, variant3_1_2.txt.text, variant3_1_3.txt.text, variant3_1_4.txt.text, variant3_1_5.txt.text, variant3_1_6.txt.text, variant3_1_7.txt.text, variant3_1_8.txt.text, variant3_1_9.txt.text,
variant3_2_1.txt.text, variant3_2_2.txt.text, variant3_2_3.txt.text, variant3_2_4.txt.text, variant3_2_5.txt.text, variant3_2_6.txt.text, variant3_2_7.txt.text, variant3_2_8.txt.text, variant3_2_9.txt.text,
variant3_3_1.txt.text, variant3_3_2.txt.text, variant3_3_3.txt.text, variant3_3_4.txt.text, variant3_3_5.txt.text, variant3_3_6.txt.text, variant3_3_7.txt.text, variant3_3_8.txt.text, variant3_3_9.txt.text);
var variant_4:Array = new Array(variant4_1_1.txt.text, variant4_1_2.txt.text, variant4_1_3.txt.text, variant4_1_4.txt.text, variant4_1_5.txt.text, variant4_1_6.txt.text, variant4_1_7.txt.text, variant4_1_8.txt.text, variant4_1_9.txt.text,
variant4_2_1.txt.text, variant4_2_2.txt.text, variant4_2_3.txt.text, variant4_2_4.txt.text, variant4_2_5.txt.text, variant4_2_6.txt.text, variant4_2_7.txt.text, variant4_2_8.txt.text, variant4_2_9.txt.text,
variant4_3_1.txt.text, variant4_3_2.txt.text, variant4_3_3.txt.text, variant4_3_4.txt.text, variant4_3_5.txt.text, variant4_3_6.txt.text, variant4_3_7.txt.text, variant4_3_8.txt.text, variant4_3_9.txt.text);
var variant_5:Array = new Array(variant5_1_1.txt.text, variant5_1_2.txt.text, variant5_1_3.txt.text, variant5_1_4.txt.text, variant5_1_5.txt.text, variant5_1_6.txt.text, variant5_1_7.txt.text, variant5_1_8.txt.text, variant5_1_9.txt.text,
variant5_2_1.txt.text, variant5_2_2.txt.text, variant5_2_3.txt.text, variant5_2_4.txt.text, variant5_2_5.txt.text, variant5_2_6.txt.text, variant5_2_7.txt.text, variant5_2_8.txt.text, variant5_2_9.txt.text,
variant5_3_1.txt.text, variant5_3_2.txt.text, variant5_3_3.txt.text, variant5_3_4.txt.text, variant5_3_5.txt.text, variant5_3_6.txt.text, variant5_3_7.txt.text, variant5_3_8.txt.text, variant5_3_9.txt.text);
var variant_6:Array = new Array(variant6_1_1.txt.text, variant6_1_2.txt.text, variant6_1_3.txt.text, variant6_1_4.txt.text, variant6_1_5.txt.text, variant6_1_6.txt.text, variant6_1_7.txt.text, variant6_1_8.txt.text, variant6_1_9.txt.text,
variant6_2_1.txt.text, variant6_2_2.txt.text, variant6_2_3.txt.text, variant6_2_4.txt.text, variant6_2_5.txt.text, variant6_2_6.txt.text, variant6_2_7.txt.text, variant6_2_8.txt.text, variant6_2_9.txt.text,
variant6_3_1.txt.text, variant6_3_2.txt.text, variant6_3_3.txt.text, variant6_3_4.txt.text, variant6_3_5.txt.text, variant6_3_6.txt.text, variant6_3_7.txt.text, variant6_3_8.txt.text, variant6_3_9.txt.text);
trace(variant_1);
trace(variant_2);
trace(variant_3);
trace(variant_4);
trace(variant_5);
trace(variant_6);
}
}
}
答案 0 :(得分:2)
好的,就像我在评论中说的那样,你的脚本可以大大缩短。这是如何做。 90行代替300+,没有双重编写代码或实例化;) 我打电话给Class Main,但你可以根据自己的需要改变它。为简单起见,我还动态生成字段,电路板Array保存所有电路板并可公开访问。
package {
import flash.display.Sprite;
import flash.text.TextField;
public class Main extends Sprite{
public var boards:Array = new Array();
private static const AMAUNT_BOARDS:uint = 6;
private static const NUMBER_FIELD_SIZE:uint = 20;
public function Main() {
for(var i:uint = 0; i < AMAUNT_BOARDS; i++)
{
var numbers:Array = genNumbers();
numbers = deleteFields(numbers);
var board:Sprite = getBoard(numbers);
board.y = NUMBER_FIELD_SIZE * 4 * i;
boards.push(board);
addChild(board);
}
}
//generates a 2 Dimensional Array (3x9) with TextFields
//populates the according Numbers and returns a board Sprite
private function getBoard(n:Array):Sprite
{
var s:Sprite = new Sprite();
var a:Array = new Array();
for(var i:uint = 0; i < 3; i++)
{
var b:Array = new Array();
for(var k:uint = 0; k < 9; k++)
{
//create TextFields
var tf:TextField = new TextField();
tf.x = k * NUMBER_FIELD_SIZE;
tf.y = i * NUMBER_FIELD_SIZE;
tf.border = true;
tf.width = NUMBER_FIELD_SIZE;
tf.height = NUMBER_FIELD_SIZE;
if(n[k][i] != 0) // adds the number if the value isn't 0
tf.text = n[k][i]; // Note that i am switching k & i because the number Array is 9x3
b.push(tf);
s.addChild(tf);
}
}
return s;
}
// Turns 4 random numbers out of the lines into 0 And returns the Array
private function deleteFields(a:Array):Array
{
for(var i:uint = 0; i < 3; i++)
{
var r:RandomPlus = new RandomPlus(8,0);
for(var k:uint = 0; k < 4; k++)
{
var t:uint = r.getNum();
a[t][i] = 0;
}
}
return a;
}
// Generates and returns a 2 Dimensional Array (9x3) with random numbers
private function genNumbers():Array
{
var a:Array = new Array();
var st:uint = 1;
var en:uint = 9;
for(var i:uint = 0; i < 9; i++)
{
var line:Array = new Array();
var ran:RandomPlus = new RandomPlus(en,st);
if(i == 0)//accounting for the number differnenz at start
st--;
if(i==7)//accounting for the number differnenz at end
en ++;
st += 10;
en += 10;
for(var e:uint = 0; e < 3; e++)
line[e] = ran.getNum();
a.push(line);
}
return a;
}
}
}
输出:
我没有真正评论代码,因为我没有时间。看看和玩耍。如果你不能跟进,我可以稍后发表评论。 我将字段大小设置为20 * 20,根据您的需要更改或其他任何内容 享受;)
编辑:添加了一些注释和字段大小常量变量!
答案 1 :(得分:0)
$ arr = new SplFixedArray(27);
for($m=1;$m<=100000;$m++)
{
in:
$final_array = array();
foreach ( $arr as $key => $val )
$final_array[ $key+1 ] = $val;
$elements_array=array();
foreach ( $arr as $key => $val )
$elements_array[ $key+1 ] = $val;
for($i=1;$i<=count($elements_array);$i++)
{
if($i==1 || $i==10 || $i==19 )
{
$elements_array[$i]=rand(1,9);
}
if($i==2 || $i==11 || $i==20 )
{
$elements_array[$i]=rand(10,19);
}
if($i==3 || $i==12 || $i==21 )
{
$elements_array[$i]=rand(20,29);
}
if($i==4 || $i==13 || $i==22 )
{
$elements_array[$i]=rand(30,39);
}
if($i==5 || $i==14 || $i==23 )
{
$elements_array[$i]=rand(40,49);
}
if($i==6 || $i==15 ||$i==24 )
{
$elements_array[$i]=rand(50,59);
}
if($i==7 || $i==16 ||$i==25 )
{
$elements_array[$i]=rand(60,69);
}
if($i==8 || $i==17 || $i==26 )
{
$elements_array[$i]=rand(70,79);
}
if($i==9 || $i==18 || $i==27)
{
$elements_array[$i]=rand(80,90);
}
}
for($k=1;$k<=5;$k++)
{
$index1=rand(1,9);
$final_array[$index1]=$elements_array[$index1];
}
$x1 = 0;
$ar1=[];
for($q=1;$q<=9;$q++)
{
if(isset($final_array[$q]))
{
$ar1[$x1]= $q;
$x1++;
}
}
loop:
if($x1 != 5)
{
$in1 =rand(1,9);
if(!in_array($in1, array_keys($ar1)))
{
$final_array[$in1]=$elements_array[$in1];
$ar[$x1]= $in1;
$x1++;
}
goto loop;
}
$z1=0;
for($q=1;$q<=9;$q++)
{
if(isset($final_array[$q]))
{
$ar1[$x1]= $q;
$z1++;
}
}
if($z1 != 5)
goto in;
for($l=1;$l<=5;$l++)
{
$index2=rand(10,18);
$final_array[$index2]=$elements_array[$index2];
}
$x2 = 0;
$ar2=[];
for($q=10;$q<=18;$q++)
{
if(isset($final_array[$q]))
{
$ar2[$x2]= $q;
$x2++;
}
}
loop2:
if($x2 != 5)
{
$in2 =rand(10,18);
if(!in_array($in2, array_keys($ar2)))
{
$final_array[$in2]=$elements_array[$in2];
$ar[$x2]= $in2;
$x2++;
}
goto loop2;
}
$z2=0;
for($q=10;$q<=18;$q++)
{
if(isset($final_array[$q]))
{
$ar1[$x1]= $q;
$z2++;
}
}
if($z2 != 5)
goto in;
for($n=1;$n<=5;$n++)
{
$index3=rand(19,27);
$final_array[$index3]=$elements_array[$index3];
}
$x3 = 0;
$ar3=[];
for($q=19;$q<=27;$q++)
{
if(isset($final_array[$q]))
{
$ar3[$x3]= $q;
$x3++;
}
}
loop3:
if($x3 != 5)
{
$in3 =rand(19,27);
if(!in_array($in3, array_keys($ar3)))
{
$final_array[$in3]=$elements_array[$in3];
$ar[$x3]= $in3;
$x3++;
}
goto loop3;
}
$z3=0;
for($q=19;$q<=27;$q++)
{
if(isset($final_array[$q]))
{
$ar3[$x3]= $q;
$z3++;
}
}
if($z3 != 5)
goto in;
DB::table('tambola')->insert(['a1'=>$final_array[1],
'a2'=>$final_array[2],
'a3'=>$final_array[3],
'a4'=>$final_array[4],
'a5'=>$final_array[5],
'a6'=>$final_array[6],
'a7'=>$final_array[7],
'a8'=>$final_array[8],
'a9'=>$final_array[9],
'b1'=>$final_array[10],
'b2'=>$final_array[11],
'b3'=>$final_array[12],
'b4'=>$final_array[13],
'b5'=>$final_array[14],
'b6'=>$final_array[15],
'b7'=>$final_array[16],
'b8'=>$final_array[17],
'b9'=>$final_array[18],
'c1'=>$final_array[19],
'c2'=>$final_array[20],
'c3'=>$final_array[21],
'c4'=>$final_array[22],
'c5'=>$final_array[23],
'c6'=>$final_array[24],
'c7'=>$final_array[25],
'c8'=>$final_array[26],
'c9'=>$final_array[27],
]);