fork(1) download
  1. <?php
  2.  
  3.  
  4. $anonDice1 = mt_rand(1,6);
  5. $anonDice2 = mt_rand(1,6);
  6.  
  7. $compDice1 = mt_rand(1,6);
  8. $compDice2 = mt_rand(1,6);
  9.  
  10. echo "У анона выпало {$anonDice1} и {$anonDice2}\nУ компьютера выпало {$compDice1} и {$compDice2}\n";
  11.  
  12. $anonSum = ($anonDice1+$anonDice2);
  13. $compSum = ($compDice1+$compDice2);
  14.  
  15. if (($anonDice1 == $anonDice2) && ($compDice1 == $compDice2)) {
  16. echo "2 дамбла - тебя ждет большая удача. Запости скриншот!!\n";
  17. exit();
  18. }
  19. if (($anonDice1 == $anonDice2) > ($compDice1 == $compDice2)) {
  20. echo "Победил анон\n";
  21. exit();
  22. }
Success #stdin #stdout 0.02s 25424KB
stdin
Standard input is empty
stdout
У анона выпало 6 и 1
У компьютера выпало 1 и 4