using GridWorld

rows = [
    [7:22],[4:22],[2:22],
    [2:22],[3:22],[4:22],
    [5:20],[5:17],[5:16],
    [5:14],[5:13],[4:13],
    [3:13],[1:13],[1:13],
]

function getgridmat(rows)
    m = falses(15, 22)
    for (row, ranges) in enumerate(rows)
        for range in ranges
            m[row, range] .= true
        end
    end
    m
end

mat = getgridmat(rows)

function cellfn(row,col)
    if (row,col) == (7,7)
        return Label("●"; color="red", size=22)
    end
    if !mat[row,col]
        return nothing
    end
    bg_color = nothing
    if row == size(mat, 1)
        bg_color = "#98b8eb"
    elseif col == size(mat, 2)
        bg_color = "#92BD8E"
    end
    Cell(
        nothing,
        line_thickness=1,
        bg_color=bg_color
    )
end

g4fn() = Grid(
    size(mat, 1),
    size(mat, 2),
    cellfn,
    line_thickness=0,
    title_right=Label("Finish Line", color="#333", size=22),
    header=Label("Starting Line", color="#333", size=22),
    margin_top=30,
    margin_bottom=30,
    margin_left=20,
    margin_right=20,
    line_color="red",
    cell_size=20,
)
g4 = g4fn()