unprompted/templates/common/examples/choose_weighted.txt

19 lines
772 B
Plaintext

[##]
A 'choose' shortcode can have options that are more likely to appear than other options.
This is made possible with the 'repeat' shortcode.
Remember to include the _sep argument in 'repeat' to format the output in the way 'choose' expects.
Bonus: the 'repeat' shortcode even supports floats! For example, if you 'repeat 4.4' then there's a 40% chance you'll get 5 outputs instead of 4.
You can use a value between 0 and 1 for a chance to skip the 'repeat' content completely. For example, 'repeat 0.2' will have an 80% chance of discarding its content. That said, if you know your repeat value is always going to be less than 1, just use 'chance' instead!
[/##]
Here's my choice:
[choose]
Option A
[repeat 5 _sep="|"]Option B[/repeat]
Option C
Option D
[/choose]