<?php
header('Content-type: text/plain');
error_reporting(E_ALL);
mb_internal_encoding('utf-8');


class Cat {
    public $range; // Много ненужного, это на БУДУЩЕЕ
    public $x;
    public $y;
    public $z;
    public $spawn;

    function spawnCat() {
        $this->range = 10;
        $this->x = true;
        $this->y = true;
        $this->z = true;
        $this->spawn = array(
            'x' => rand(0, 9),
            'y' => rand(0, 9));
    return $this->spawn;
    }
}

class Field {
    public $width;
    public $height;

    function createBlankField() {
        $this->width = 10;
        $this->height = 10;
        $field = array(
            array(".", ".", ".", ".", ".", ".", ".", ".", ".", "."),
            array(".", ".", ".", ".", ".", ".", ".", ".", ".", "."),
            array(".", ".", ".", ".", ".", ".", ".", ".", ".", "."),
            array(".", ".", ".", ".", ".", ".", ".", ".", ".", "."),
            array(".", ".", ".", ".", ".", ".", ".", ".", ".", "."),
            array(".", ".", ".", ".", ".", ".", ".", ".", ".", "."),
            array(".", ".", ".", ".", ".", ".", ".", ".", ".", "."),
            array(".", ".", ".", ".", ".", ".", ".", ".", ".", "."),
            array(".", ".", ".", ".", ".", ".", ".", ".", ".", "."),
            array(".", ".", ".", ".", ".", ".", ".", ".", ".", ".")
        );
    return $field;
    }
}
$fieldObj = new Field();
$blankField = $fieldObj->createBlankField();

for ($x = 0; $x < 10; $x++) {
    for ($y = 0; $y < 10; $y++) {
        echo $blankField[$x][$y];
    }
    echo "\n";
}
echo "\n";

$catObj = new Cat();
$cat = $catObj->spawnCat();

$xc = $cat['x'];
$yc = $cat['y'];

$field = $blankField;
$field[$xc][$yc] = "C";
for ($x = 0; $x < 10; $x++) {
    for ($y = 0; $y < 10; $y++) {
        echo $field[$x][$y];
    }
    echo "\n";
}
echo "\n";
?>