gen/
gen.rs

1extern crate zalgo;
2
3use zalgo::{Generator, GeneratorArgs, ZalgoSize};
4
5// Generate a string of Zalgo with a low amount of custom configuration.
6fn main() {
7    let mut generator = Generator::new();
8
9    // Create Zalgo text with Zalgo `char`s in all positions, with a maximum
10    // amount of Zalgo:
11    generator.gen("test", &mut String::new(), &GeneratorArgs::new(true, true, true, ZalgoSize::Maxi));
12
13    // Create Zalgo text with Zalgo `char`s in only the middle and lower
14    // positions, with a minimum amount of Zalgo:
15    generator.gen("test", &mut String::new(), &GeneratorArgs::new(false, true, true, ZalgoSize::Mini));
16
17    // Create Zalgo text with Zalgo `char`s in only the lower position, with a
18    // random amount of Zalgo (can be a low amount or high amount):
19    generator.gen("test", &mut String::new(), &GeneratorArgs::new(false, false, true, ZalgoSize::None));
20
21    // Consequentially, you can also not modify your given text with any Zalgo:
22    // Technically the `ZalgoSize` value given does not matter here.
23    generator.gen("test", &mut String::new(), &GeneratorArgs::new(false, false, false, ZalgoSize::None));
24}