Home About Random
from ipythonblocks import BlockGrid
hoshis = [3,9,15]
color = {'b': (0,0,0), 'w': (255,255,255), 't': (220,200,0), 'h': (255,100,0)}
game = 'b16,4 w4,17 b16,16 w4,3 b16,11 w14,3'

grid= BlockGrid(19,19, fill=color['t'], block_size=17)

for y in hoshis:
    for x in hoshis:
        grid[y,x] = color['h']

for m in game.split(' '):
    x,y = m[1:].split(',')
    grid[int(y)-1, int(x)-1] = color[m[0:1]]
grid
grid.post_to_web('1:8')