You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
coffee-table/index.php

35 lines
850 B

<?php
namespace Coffee;
require __DIR__ . '/vendor/autoload.php';
try {
$map = [
[0, 1, 0, 1],
[1, 0, 0, 0],
[0, 0, 0, 1],
[0, 0, 1, 1]
];
$table = new Table($map);
echo '<table>' . "\n";
foreach ($table->getStructuredTiles() as $row) {
echo '<tr>' . "\n";
/** @var Tile $tile */
foreach ($row as $tile) {
$formattedTile = $tile->getSpotNumber() == 0 ? '' : $tile->getSpotNumber();
echo '<td>' . $formattedTile . '</td>' . "\n";
}
echo '</tr>' . "\n";
}
echo '</table>' . "\n";
// echo 'Najväčšia kávová kaluž je s číslom '.$table->getLargestSpot()->ge
}
catch (\Exception $e) {
// TODO: provide more information, like the file:line for example
echo 'Caught exception: ' . $e->getMessage() . "\n";
}