1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use crate;
use crate*;
/// [`String`] builder for [`dice::collection`].
///
/// [`dice::collection`]: dice::collection()
;
/// Generates a [`String`] that contains the specified [`char`]s.
///
/// The range specifies the number of [`char`]s in the [`String`].
///
/// # Panics
///
/// Panics if the range is empty.
///
/// # Examples
///
/// ```
/// use dicetest::prelude::*;
/// use dicetest::{Prng, Limit};
///
/// let mut prng = Prng::from_seed(0x5EED.into());
/// let limit = Limit::default();
/// let mut fate = Fate::new(&mut prng, limit);
///
/// let char_die = dice::char();
///
/// let string = fate.with_limit(100.into()).roll(dice::string(&char_die, ..));
/// assert!(string.chars().count() <= 100);
///
/// let string = fate.roll(dice::string(&char_die, ..=73));
/// assert!(string.chars().count() <= 73);
///
/// let string = fate.roll(dice::string(&char_die, 17..));
/// assert!(string.chars().count() >= 17);
///
/// let string = fate.roll(dice::string(&char_die, 42));
/// assert!(string.chars().count() == 42);
/// ```