<?php
class Animal
{
public $x;
public $y;
}
class Mouse extends Animal
{
public $icon;
public function makeStep()
{
}
}
class Cat extends Animal
{
public $icon;
public function makeStep()
{
}
}
class World
{
public $map = [];
public function __construct($m, $n)
{
}
public function drawMap()
{
foreach ($this->map as $lines){
for ($i=1; $i <= count($lines); $i++) { echo " " . $lines[$i] . " ";
}
echo "\n";
}
}
}
$testWorld = new World(2, 3);
$testWorld->drawMap();
PD9waHAKZXJyb3JfcmVwb3J0aW5nKC0xKTsKCmNsYXNzIEFuaW1hbAp7CglwdWJsaWMgJHg7CglwdWJsaWMgJHk7CgkKfQoKY2xhc3MgTW91c2UgZXh0ZW5kcyBBbmltYWwgCnsKCXB1YmxpYyAkaWNvbjsKCXB1YmxpYyBmdW5jdGlvbiBtYWtlU3RlcCgpCgl7CgkJCgl9Cn0KCmNsYXNzIENhdCBleHRlbmRzIEFuaW1hbAp7CglwdWJsaWMgJGljb247CglwdWJsaWMgZnVuY3Rpb24gbWFrZVN0ZXAoKQoJewoJCQoJfQp9CgpjbGFzcyBXb3JsZAp7CglwdWJsaWMgJG1hcCA9IFtdOwoJCglwdWJsaWMgZnVuY3Rpb24gX19jb25zdHJ1Y3QoJG0sICRuKQoJewoJCSR0aGlzLT5tYXAgPSBhcnJheV9maWxsKDEsICRtLCBhcnJheV9maWxsKDEsICRuLCAwKSk7Cgl9CgkKCXB1YmxpYyBmdW5jdGlvbiBkcmF3TWFwKCkKCXsKCQlmb3JlYWNoICgkdGhpcy0+bWFwIGFzICRsaW5lcyl7CgkJCWZvciAoJGk9MTsgJGkgPD0gY291bnQoJGxpbmVzKTsgJGkrKykgewoJCQkJZWNobyAiICIgLiAkbGluZXNbJGldIC4gIiAiOwoJCQl9CgkJCWVjaG8gIlxuIjsKCQl9Cgl9Cgp9CgokdGVzdFdvcmxkID0gbmV3IFdvcmxkKDIsIDMpOwoKJHRlc3RXb3JsZC0+ZHJhd01hcCgpOw==