Home About Random
from ipythonblocks import BlockGrid, fui_colors
def zero(grid, row, col, color):
    # draw a 0 in a grid 6 blocks wide by 8 blocks high
    g = grid[row:row + 8, col:col + 6]
    g[2:2 + 4, 0] = color
    g[2:2 + 4, 5] = color
    g[0, 2:2 + 2] = color
    g[7, 2:2 + 2] = color
    g[1, 1] = color
    g[1, 4] = color
    g[6, 1] = color
    g[6, 4] = color
def five(grid, row, col, color):
    # draw a 0 in a grid 6 blocks wide by 8 blocks high
    g = grid[row:row + 8, col:col + 6]
    g[0, :] = color
    g[:3, 0] = color
    g[3, 1:1 + 4] = color
    g[4:4 + 3, 5] = color
    g[7, 1:1 + 4] = color
    g[6, 0] = color
fg = fui_colors.Pomegranate
bg = fui_colors.Clouds

grid = BlockGrid(22, 10, fill=bg)

five(grid, 1, 1, fg)
zero(grid, 1, 8, fg)
zero(grid, 1, 15, fg)

grid
grid.post_to_web('1,3,4,7,8')