<?php
session_start();
$num1 = Rand(0,10);
$num2 = Rand(0,10);
$wha = array('+','-');
$img = array('./cap/cap0.jpg','./cap/cap1.jpg','./cap/cap2.jpg','./cap/cap3.jpg','./cap/cap4.jpg','./cap/cap5.jpg','./cap/cap6.jpg','./cap/cap7.jpg','./cap/cap8.jpg','./cap/cap9.jpg','./cap/cap10.jpg');
$img1 = array('./cap/cap0.jpg','./cap/cap1.jpg','./cap/cap2.jpg','./cap/cap3.jpg','./cap/cap4.jpg','./cap/cap5.jpg','./cap/cap6.jpg','./cap/cap7.jpg','./cap/cap8.jpg','./cap/cap9.jpg','./cap/cap10.jpg');
if($num1>$num2)
{
$whado = $wha[Rand(0,1)];
if($whado=='+')
{
$rez=$num1+$num2;
echo "<img width='35' height='35' src='$img[$num1]'>"; echo "<img width='35' height='35' src='./cap/plus.jpg'>"; echo "<img width='35' height='35' src='$img1[$num2]'>"; echo $rez . "<br>";
echo "$num1 + $num2 = ";
// echo $num1+$num2;
}
if($whado=='-')
{
$rez=$num1-$num2;
echo "<img width='35' height='35' src='$img[$num1]'>"; echo "<img width='35' height='35' src='./cap/minus.jpg'>"; echo "<img width='35' height='35' src='$img1[$num2]'>"; echo $rez . "<br>";
echo "$num1 - $num2 = ";
// echo $num1-$num2;
}
//$ans = $num1.$whado.$num2;
//echo "$num1 " . $wha[Rand(0,1)] . " $num2 =" . $ans;
//echo $whado . " IF 1";
}
if($num2>$num1)
{
$whado = $wha[Rand(0,1)];
if($whado=='+')
{
$rez=$num2+$num1;
echo "<img width='35' height='35' src='$img[$num2]'>"; echo "<img width='35' height='35' src='./cap/plus.jpg'>"; echo "<img width='35' height='35' src='$img1[$num1]'>"; echo $rez . "<br>";
echo "$num2 + $num1 = ";
// echo $num2+$num1;
}
if($whado=='-')
{
$rez=$num2-$num1;
echo "<img width='35' height='35' src='$img[$num2]'>"; echo "<img width='35' height='35' src='./cap/minus.jpg'>"; echo "<img width='35' height='35' src='$img1[$num1]'>"; echo $rez . "<br>";
echo "$num2 - $num1 = ";
// echo $num2-$num1;
}
}
if($num1==$num2)
{
$rez=$num1+$num1;
echo "<img width='35' height='35' src='$img[$num1]'>"; echo "<img width='35' height='35' src='./cap/plus.jpg'>"; echo "<img width='35' height='35' src='$img1[$num1]'>"; echo $rez . "<br>";
echo "$num1 + $num2 = ";
//echo $num1+$num2;
}
/*if($num1<=$num2)
{
$whado = $wha[Rand(0,1)];
if($whado=='
//echo $whado1 . " IF 2";
//echo "$num2 " . $wha[Rand(0,1)] . " $num1 =" . $num1 . $wha[Rand(0,1)] . $num2;
}
*/
?>