Skip to content

Limits

tilttek/dice

Limits bounds what an expression may ask for, against abuse. What goes past a limit is refused with LimitExceeded, never truncated.

LimitDefaultChecked
dice100The dice a pool rolls or lists and the items it draws from text lists, before rerolls and explosions, when it is parsed and when it is rolled — every branch counted when parsed, the branch that holds when rolled, what repeat() repeats once for each time; a count rolled first is counted once rolled
sides1000The sides of each numbered die and the faces of a die on a range, at the same times; sides rolled first once rolled
explosions100The explosions of a roll, every kind and the dice of dice all the same, across the whole pool, as they happen
expressions10The instructions of a pool
length256The characters of an input, before it is parsed
rerolls100The rerolls of a roll — repeated, once or unique —, across the whole pool, as they happen
repetitions100The repetitions of repeat(), across the whole pool — those within repeat() once for each time —, when it is parsed and as they happen; a count rolled first is counted once rolled
text4096The characters of a text a sentence gives, once its placeholders are replaced

Each limit is at least 1. A count that goes past the range of an integer is taken as the largest integer, and refused. Pass the same Limits to the parser and the roller — DiceRoller does — so that a pool built in code is held to the same bounds as one typed by a person.