Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
??{#Unique[±_<:BinBelow!#_:>Sum]}
data := Random[
range := 10
inner := Chunk[Sort[data], Floor@`/&range]
keys ' values := Tr[inner]
size := Max[Size => keys] + 3
width := size + 2
format_key[key] := "[" + Center[String[key], size] + "]"
col_widths := Size => values
el := Center["#", width]
pad := " " * width
Print[OverGrid[Reverse@Tr]!Grid[Repeat[el, col_widths],pad]]
Print[...keys * range :> format_key, joiner->es]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment