Skip to content

Instantly share code, notes, and snippets.

@ConorOBrien-Foxx
Created April 23, 2018 20:09
Show Gist options
  • Save ConorOBrien-Foxx/59cf66c55cbd3e41567c48892d7d277a to your computer and use it in GitHub Desktop.
Save ConorOBrien-Foxx/59cf66c55cbd3e41567c48892d7d277a to your computer and use it in GitHub Desktop.
??{#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