def format_board(state):
    """Format the board"""

    cells = []
    for i, char in enumerate(state, start=1):
        cells.append(str(i) if char == '.' else char)

    bar = '-------------'
    cells_tmpl = '| {} | {} | {} |'
    return '\n'.join([
        bar,
        cells_tmpl.format(cells[0], cells[1], cells[2]), bar,
        cells_tmpl.format(cells[3], cells[4], cells[5]), bar,
        cells_tmpl.format(cells[6], cells[7], cells[8]), bar
    ])