<?php
error_reporting(-1);
mb_internal_encoding("utf-8");

class World {
	
	public $sideLength;
	public $field = array();

	function __construct($sideLength) {
		$this->sideLength = $sideLength;
		$this->field = array_fill(1, $sideLength, array_fill(1, $sideLength, "0"));		
	}

	function draw() {
		foreach ($this->field as $line) {
			echo implode("  ",$line);
			echo "\n";
		}
	}

	function place(Animal $animal) {
		$x = mt_rand(1, $this->sideLength);
		$y = mt_rand(1, $this->sideLength);

		$this->field[$x][$y] = $animal->icon;
	}

}

abstract class Animal {
	public $x;
	public $y;
	public $icon;

	function __construct($icon) {
		$this->icon = $icon;
	}
}

class Mouse extends Animal {
	public function move () {

	}
}

$world1 = new World(8);

$mouse1 = new Mouse('1');

$world1->place($mouse1);

$world1->draw();

?>