require'ide/qt/gl2' coinsert'jgl2' NB. corners of a unit hexagon ucorn=: +.^j.2p1*(%~i.)6 NB. center to center offset for columns and rows uof=: %:2.3 3 shape=: 4 5 scale=: 50 scorn=: scale*ucorn centers=: scale*(((%:0 0.75)*/~2|{:"1)+uof*"1 1:+|."1)shape#:i.shape honeycomb=: {{)n pc honeycomb nosize closeok; minwh 460 460; cc hex isidraw flush; pshow; }}{{ sel=: 0"0 grid=: shape$u:65+(*/shape)?26 txt=:'' wd m draw y }} draw=: {{ glfill 0 0 0 255 hex"0 i.$grid gltextcolor glrgb 0 0 255 glfont 'courier 24' gltextxy 60 10 glpaint gltext txt }} hex=: {{ coord=. k{dist do.select_character k end. }} honeycomb''