Shorthand Lists

## Introduction

Sometimes you'll just want to randomly choose between a few items, and creating a whole list just for that isn't desirable.

## Examples

### Normal Shorthand

In this case we can use some "curly bracket" shorthand notation:

```
sentence
	That's a {very|extremely} {tiny|small} [animal]!
	I {think|believe} that you are a {liar|thief}.
	I'd be so {rich|poor} if not for that person.

```

Inside the curly brackets, you separate items with a vertical bar (or "pipe" ( `|` )) character, which you can find near the curly brackets keys on most keyboards. When the Perchance engine "evaluates" the text it replaces the "curly block" with a randomly selected item from within that block. It's essentially a way to embed "mini lists" within an item.

**What Does "Evaluate" Mean?**The words "evaluate", "resolve", and "execute" in sentences like these:
* Perchance *evaluates* `{dog|cat}`, replacing it with either 'dog' or 'cat'.
* The Perchance engine *resolves* `[plant]`, replacing it with a random item from the `plant` list.
* Perchance executes the square block, `[food]`, which outputs a random food item.

Are basically interchangeable - they mean the same thing. "Evaluate", "Resolve" or "Execute", refers to Perchance **converting text with square and curly brackets into "plain" text** (i.e. text *without* any curly/square brackets) by randomly selecting items from lists and short-hand (within curly brackets) lists according to the odds that you have specified. So whenever you see "evaluate", "resolve" or "execute", just mentally replace that with "convert into plain text by making the appropriate random selections".

Here are a few more examples of their usage in case it's helpful:

* `{dog|cat}` *resolves* into 'dog' or 'cat'.
* If we evaluate `[flower]`, then we'll get something like "tulip".
* Execution of square blocks happens in the order in which they appear in your text.

### List of Lists Shorthand

You might have guessed already, but we can do stuff like this too: `The country is known to contain many species of {[animal]|[plant]}`. That is, you can put square blocks inside curly blocks.

NoteNote that **spaces matter** in curly blocks, so `{hi|hello}` is different to `{ hi | hello }`. In square blocks, spaces are ignored. So [animal] is the same as [ animal ]
### A/An Shorthand

Curly blocks are used for all sorts of other fancy tricks in Perchance. Take this sentence, for example: `I'm a [animal]`. If the result of [animal] happens to start with a vowel, then the grammar won't be right: `I'm a antelope` - it should be `I'm **an** antelope`.

We could manually fix this by having two separate lists of animals (ones that need "a" and ones that need "an"), but that'd be a pain. Instead we can just do this: `I'm {a} [animal]`. By using the `{a}` curly block, the correct article (a/an) will be chosen based on what is appropriate for the next word.

### Ranges

Instead of writing `{1|2|3}`, we can write `{1-3}`. This is especially handy for much larger number ranges like`{1-500}`. You can also choose a random letter with the same notation. `{a-z}` chooses a random lower case letter. `{a-f}` chooses a random lower case letter between "a" and "f". This also works for upper case letters: `{A-Z}.`