fork download
  1. <?php
  2. class Mouse {
  3. public $x;
  4. public $y;
  5.  
  6. public $speed = 2;
  7.  
  8. public function __construct() {
  9. $this->x = mt_rand();
  10. $this->y = mt_rand();
  11. }
  12.  
  13. public function move() {
  14. for ($x = $this->x - $speed; $x <= $this->x + $speed; $x++) {
  15. for ($y = $this->y - $speed; $y <= $this->y + $speed; $y++) {
  16. //определяем расстояние до кошки и высчитываем баллы
  17. }
  18. }
  19. }
  20. }
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
Standard output is empty