<commit_before>tmol (Twisty Maze Of Lists)
===========================

So I was reading through the D&D 3.5 Dungeon Master's Guide and implemented
a little language for describing the dice-based tables therein.

There's some samples in the data/ directory.

# Language features

At the most basic level, tables from the DMG can be directly transcribed.
Lines starting with # are comments. Leading and trailing whitespace is
ignored.

```
# boring
1-10	sword
11-20	spear
21-25	morningstar
# Flails are badass. See: Lord of the Rings
26-30	flail
```

## Inline subtables - for things like the 'mundane items' table in the DMG

```
26-30	{ 1-10 flail; 11-18 dire flail; 19-20 double flail; }
# for equal chance of all items in a subtable, add the even: tag
31-35	{ even: dagger; knife; kris; machete; }
```

## External subtables

```
26-30	@flails.table
```

## Combined inline and external subtables

```
26-30	{ even: @flails.table; @morningstars.table; @chains.table; }
```

## Multiple items

```
36-40	multi 3d6+1 caltrops
# this also works with subtables
41-45	multi 1d4+1 { 1-3 wineskin; 4-8 iron rations; 9-10 salted pork; }
# or if you want them to select multiple of all the same item,
# eg. randomly choose wineskin OR iron rations OR salted pork, then return
# 1d4+1 of whichever one was chosen
41-45	group 1d4+1 { 1-3 wineskin; 4-8 iron rations; 9-10 salted pork; }
```<commit_msg>update README to demo more syntax<commit_after>tmol (Twisty Maze Of Lists)
===========================

So I was reading through the D&D 3.5 Dungeon Master's Guide and implemented
a little language for describing the dice-based tables therein.

There's some samples in the data/ directory.

# Language features

At the most basic level, tables from the DMG can be directly transcribed.
Lines starting with # are comments. Leading and trailing whitespace is
ignored.

```
# boring
1-10	sword
11-20	spear
21-25	morningstar
# Flails are badass. See: Lord of the Rings
26-30	flail
```

## Inline subtables - for things like the 'mundane items' table in the DMG

```
26-30	{ 1-10 flail; 11-18 dire flail; 19-20 double flail; }
# for equal chance of all items in a subtable, add the even: tag
31-35	{ even: dagger; knife; kris; machete; }
```

## External subtables

```
26-30	@flails.table
```

## Combined inline and external subtables

```
26-30	{ even: @flails.table; @morningstars.table; @chains.table; }
```

## Multiple items

```
# return 4-19 caltrops
36-40	multi 3d6+1 caltrops

# this also works with subtables, but it will roll from the subtable
# every time - 1d4+1 times in this case, so multiple different items
# may be selected (eg. wineskins AND iron rations AND salted pork)
41-45	multi 1d4+1 { 1-3 wineskin; 4-8 iron rations; 9-10 salted pork; }

# or if you want them to select multiple of all the same item,
# eg. randomly choose wineskin OR iron rations OR salted pork, then return
# 1d4+1 of whichever one was chosen
41-45	group 1d4+1 { 1-3 wineskin; 4-8 iron rations; 9-10 salted pork; }

# the 'oneofeach' qualifier will 'execute' every item in a subtable
# eg. this might return a wineskin, 2 iron rations and, 10% of the time,
# some cheese
46-47	oneofeach 1d6 { even: wineskin; multi 1d4 iron rations; 10% cheese; }
```

## Chance

```
# you can put a percentage before any table entry to make it that likely,
# eg. if this table slot comes up on the dice, a percentage roll then
# happens. eg. 2% chance of getting something incredibly valuable
48-50	2% { even: <NAME>; <NAME>; <NAME>; }
```
{'fraction_non_alphanumeric': 0.10946408209806158, 'fraction_numerical': 0.05387685290763968, 'mean_word_length': 3.984375, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3884641', 'n_tokens_mistral': 1312, 'n_tokens_neox': 1136, 'n_words': 508}