Honeycombs: Difference between revisions

Content added Content deleted
(J)
Line 1,872: Line 1,872:
uof=: %:2.3 3
uof=: %:2.3 3


shape=:4 5
shape=: 4 5
scale=:50
scale=: 50
scorn=: scale*ucorn
scorn=: scale*ucorn
centers=: scale*(((%:0 0.75)*/~2|{:"1)+uof*"1 1:+|."1)shape#:i.shape
centers=: scale*(((%:0 0.75)*/~2|{:"1)+uof*"1 1:+|."1)shape#:i.shape
Line 1,883: Line 1,883:
pshow;
pshow;
}}{{
}}{{
sel=:0"0 grid=: shape$u:65+(*/shape)?26
sel=: 0"0 grid=: shape$u:65+(*/shape)?26
txt=:''
txt=:''
wd m
wd m
Line 1,899: Line 1,899:


hex=: {{
hex=: {{
coord=.<shape#:y
coord=. <shape#:y
center=. coord{centers
center=. coord{centers
glbrush glrgb (-coord{sel)|.255 255 0
glbrush glrgb (-coord{sel)|.255 255 0
Line 1,912: Line 1,912:


select_character=: {{
select_character=: {{
if.-. y{,sel do. NB. the selected character has been determined
if. -. y{,sel do. NB. the selected character has been determined
txt=:txt, y{,grid
txt=:txt, y{,grid
end.
end.
Line 1,919: Line 1,919:


honeycomb_hex_char=: {{
honeycomb_hex_char=: {{
ch=.toupper {.sysdata
ch=. toupper {.sysdata
if. ch e. ,grid do. select_character (,grid)i.ch end.
if. ch e. ,grid do. select_character (,grid)i.ch end.
}}
}}


honeycomb_hex_mbldown=:{{
honeycomb_hex_mbldown=:{{
xy=.2{.".sysdata
xy=. 2{.".sysdata
k=. (i.<./)dist=.,+/&.:*:"1 centers-"1 xy
k=. (i.<./)dist=.,+/&.:*:"1 centers-"1 xy
if.scale >k{dist do.select_character k end.
if. scale > k{dist do.select_character k end.
}}
}}