I,i have this array which define each number it's color
$zero = array(0=>"Empty",1=>"Red");
$red = array(3=>"Red",5=>"Red",7=>"Red",9=>"Red",12=>"Red",14=>"Red",16=>"Red",21=>"Red",23=>"Red",25=>"Red",27=>"Red",30=>"Red",32=>"Red",34=>"Red",36=>"Red");
$black = array(2=>"Black",4=>"Black",6=>"Black",8=>"Black",10=>"Black",11=>"Black",13=>"Black",15=>"Black",17=>"Black",22=>"Black",24=>"Black",29=>"Black",31=>"Black",33=>"Black",35=>"Black");
$spin_numbers =array_merge($zero,$red,$black);
and I have form,which ask for number to bet,and it's start choosing random number between 0 and 36
if (isset($_POST['odd']))
{
$random_number = mt_rand(0,36);
if ($random_number == 1 OR $random_number == 3 OR $random_number == 5 OR $random_number == 7 OR $random_number == 9 OR $random_number == 11 OR $random_number == 13 OR $random_number == 15 OR $random_number == 17 OR $random_number == 19 OR $random_number == 21)
{
echo $random_number." ".$roulette_numbers[$random_number]." Occured,you won!";
}
else if ($random_number == 23 OR $random_number == 25 OR $random_number == 27 OR $random_number == 29 OR $random_number == 31 OR $random_number == 33 OR $random_number == 35)
{
echo $random_number." ".$roulette_numbers[$random_number]." Occured,you won!";
}
else if($random_number == 2 OR $random_number == 4 OR $random_number == 6 OR $random_number == 8 OR $random_number == 10 OR $random_number == 12 OR $random_number == 14 OR $random_number == 16 OR $random_number == 18 OR $random_number == 20 OR $random_number == 22)
{
"Sorry,".$random_number."Occured,your stake goes to Roulette";
}
else if ($random_number == 24 OR $random_number == 26 OR $random_number == 28 OR $random_number == 30 OR $random_number == 32 OR $random_number == 34 OR $random_number == 36)
{
"Sorry,".$random_number."Occured,your stake goes to Roulette";
}
}
I want Odd numbers which most of them is Red,echo Win Message,and the rest numbers which is Even,echo loose Message,but it's only echo win Message,why?
Aucun commentaire:
Enregistrer un commentaire