Codice PHP:
if($rand<=$prob)     { echo"<font color='red'>Hai colpito!!!</font>";       } 
elseif(
$rand>=$prob) { echo"<font color='red'>Colpo andato a vuoto</font>"; } 
elseif(
$rand == 1)   { echo"<font color='red'>Supercolpo!!!</font>";        } 
elseif(
$rand == 100) { echo"<font color='red'>Hai lisciato.</font>"
se $rand è uguale a 1 mi esce "hai colpito"!!

se $rand è uguale a 100 mi esce "colpo andato a vuoto"!!