--- title: d216 and markdown tables date: 2021-09-14 keywords: [markdown, dice, tables, bash, linux, shell] --- I wanted to make a table (for [table of tavern names]) that uses *d216* type notation. This is when you roll a *d6* three times (or three diff colours at the same time and declaring one *d6* as high, one as middle and one as low) and instead of adding them you concatenate the numbers.[^nomine] This produces 216 unique numbers. As it's similar to [base6 / senary][senary]. It has numbers that change the order of magnitude at the 6th digit, for example: * ... * 165 * 166 * 211 * 212 * ... Here's a shell one-liner to generate a markdown table for *d216*: ``` bash printf '| d216 | foo |\n|:----:| --- |\n' ; \ for i in {1..6}{1..6}{1..6} ; do printf '| %4d | |\n' "$i" ; done ``` The above produces: ``` markdown | d216 | foo | |:----:| --- | | 111 | | | 112 | | | 113 | | | 114 | | | 115 | | | 116 | | | 121 | | | 122 | | | 123 | | ...etc ``` A single brace expansion `{1..216}` wont work, as that uses *base10* and produces numbers that can't be rolled using *d6*s. [^nomine]: As apposed to the other roll three *d6* system used for '[In Nomine]' [senary]: https://en.wikipedia.org/wiki/Senary [table of tavern names]: rpg_table_of_tavern_names.html [In Nomine]: https://en.wikipedia.org/wiki/In_Nomine_(role-playing_game)