[2 [0 , +:] do] `edge def \ glue 0 to top, left; [[|:] map |:] `mirror def \ t -> b, l -> r; [2 [edge mirror] do] `pad def \ pad around matrix; [[[1]]] `flake def \ simple snowflake; [1 !.] `l def \ left shift; [-1 !.] `r def \ right shift; [[[[r] map r ] [[r] map l ] [[l] map r ] [[l] map l ] [[l] map ] [[r] map ] [r ] [l ]] [i] right] `adj def \ adjacencies; [dup 4 !: swap [*] swap mods [id id ~: ~:] [i] right amend4] `alt def \ hexagonal neighbors; [^: 1 @ !: 2 !] `mods def \ 0 1 0 ..; [dup adj alt [+] iterate 1 = |] `next def \ next generation; [dup #: [0 0 1 1] # swap unit cons [!] each] `shift def \ shift pairs of rows; [2 [[,: 2 #.] map flatten +:] do] `double def \ double rows and cols; [next dup double shift " *" of sysout;] `hex def \ next, output; [[sysin C ~] [hex] while] `go def \ continue until input; flake 3 [pad] do go;