' . "\n"; foreach ($table->getStructuredTiles() as $tileRow) { echo '' . "\n"; /** @var Tile $tile */ foreach ($tileRow as $tile) { $attribute = ''; if ($tile->isRepresentingSpot()) { $attribute = ' class="coffee"'; } $spotNumber = $tile->getSpot()->getNumber(); echo '' . $spotNumber . '' . "\n"; } echo '' . "\n"; } echo '' . "\n"; echo '
' . "\n"; // TODO: introduce i18n/pluralism echo 'The biggest coffee spot is of number '; $numbers = ''; $delimiter = ', '; foreach ($table->getLargestSpots() as $spot) { $numbers .= $spot->getNumber() . $delimiter; } echo rtrim($numbers, $delimiter) . '
' . "\n"; echo 'The spot is ' . $table->getFirstLargestSpot()->getSize() . ' tiles large.
' . "\n"; echo 'The number of spots is: ' . $table->getSpotsCount() . '
' . "\n"; } catch (\Exception $e) { // TODO: provide more information, like the file:line for example echo '
' . "\n"; echo 'Caught exception: ' . $e->getMessage() . "\n"; }