<?php

class FieldCreator
{
	const WIDTH = 8;
	const HEIGHT = 6;
	
	public function showField($animal)
	{
		$animals = $animal->getPoint();
		for ($i = 0; $i < self::HEIGHT; $i++) {
			for ($i = 0; $i < self::WIDTH; $i++) {
				if ($animals[$i] == array(self::WIDTH, self::HEIGHT)) {
					echo "m";
				} else {
					echo ".";
				}
			}
		}
	}
}

abstract class Animals
{
	public $count;
	
	public function getPoint()
	{
		for($i = 0; $i < $this->count; $i++) {
			$point[$i] = array (mt_rand(1, FieldCreator::WIDTH), mt_rand(1, FieldCreator::HEIGHT));
		}
		return $point;
	}
}

class Mice extends Animals
{
	public $count = 4;
}

class Cats extends Animals
{
	public $name = "K";
	public $count = 2;
}

$mice = new Mice;

$f1 = new FieldCreator;
$f1->showField($mice);