<?php
// FEN in Array umwandeln
function fenToBoard($fen) {
    $rows  = explode('/', explode(' ', $fen)[0]);
    $board = [];
    foreach ($rows as $row) {
        $boardRow = [];
        $chars    = str_split($row);
        foreach ($chars as $char) {
            if (is_numeric($char)) {
                for ($i = 0; $i < intval($char); $i++) {
                    $boardRow[] = '';
                }
            } else {
                $boardRow[] = $char;
            }
        }
        $board[] = $boardRow;
    }

    return $board;
}?>

<?php snippet('layout', slots: true) ?>
    <div class="blockpage">
        <?= $page->blocks()->toBlocks() ?>
    </div>
<?php endsnippet() ?>