The game is Super Mind. It is usually met on mobiles.
The pc randomly keeps in mind a number of 4 digits (unequal). The player has 7 tries to guess. He enters 4 digits, if the number is present & in the right place it prints it out, or the number is present & in wrong place it prints it out. (eg. 2 right, 1 w.p.)
I'm not good in php so I would be grateful if someone told me what is wrong with my code.
<?
$score = 0;
$sco = 0;
$1 = $2;
while ($1 = $2 | $1 = $3 | $1 = $4 | $2 = $3 | $2 = $4 | $3 = $4){
$1 = rand (0:9);
$2 = rand (0:9);
$3 = rand (0:9);
$4 = rand (0:9);
}
while ($i <= 7) {
echo "
<form name=form1 method=post action=>
<input name=a type=text value= size=1 maxlength=1>
<input name=b type=text value= size=1>
<input name=c type=text value= size=1>
<input name=d type=text value= size=1>
<input type=submit name=Submit value=Go!>
</form>"
If ($a = $1 & $b = $2 & $c = $3 & $d = $4){
print ( You won!!!);
} else {
if ($a = $1){
$score = $score + 1;
} elseif ($b = $2){
$score = $score + 1;
} elseif ($c = $3){
$score = $score + 1;
} elseif ($d = $4){
$score = $score + 1;
} elseif ($a = $2 | $a = $3 | $a = $4){
$sco = $sco + 1;
} elseif ($b = $1 | $b = $3 | $b = $4){
$sco = $sco + 1;
} elseif ($c = $1 | $c = $2 | $c = $4){
$sco = $sco + 1;
} elseif ($d = $1 | $d = $2 | $d = $3){
$sco = $sco + 1;
}
$count = $count + 1;
print ( A = $score, B = $sco);
}
}
print (You have lost! The number was $a, $b, $c, $d .);
?>