<?php
class Mouse {
public $x;
public $y;
public $speed = 2;
public function __construct() {
}
public function move() {
for ($x = $this->x - $speed; $x <= $this->x + $speed; $x++) {
for ($y = $this->y - $speed; $y <= $this->y + $speed; $y++) {
//определяем расстояние до кошки и высчитываем баллы
}
}
}
}
PD9waHAKY2xhc3MgTW91c2UgewoJcHVibGljICR4OwoJcHVibGljICR5OwoJCglwdWJsaWMgJHNwZWVkID0gMjsKCQoJcHVibGljIGZ1bmN0aW9uIF9fY29uc3RydWN0KCkgewoJCSR0aGlzLT54ID0gbXRfcmFuZCgpOwoJCSR0aGlzLT55ID0gbXRfcmFuZCgpOwoJfQoJCglwdWJsaWMgZnVuY3Rpb24gbW92ZSgpIHsKCQlmb3IgKCR4ID0gJHRoaXMtPnggLSAkc3BlZWQ7ICR4IDw9ICR0aGlzLT54ICsgJHNwZWVkOyAkeCsrKSB7CgkJCWZvciAoJHkgPSAkdGhpcy0+eSAtICRzcGVlZDsgJHkgPD0gJHRoaXMtPnkgKyAkc3BlZWQ7ICR5KyspIHsKCQkJCS8v0L7Qv9GA0LXQtNC10LvRj9C10Lwg0YDQsNGB0YHRgtC+0Y/QvdC40LUg0LTQviDQutC+0YjQutC4INC4INCy0YvRgdGH0LjRgtGL0LLQsNC10Lwg0LHQsNC70LvRiwoJCQl9CgkJfQoJfQkKfQ==