carykh-macro-rust 0.1.0

A rust macro for finding strings that contain self-referential numbers. Inspired by carykh. This description contains twenty-seven words, fifty-four vowels, and ninety-nine consonants.
Documentation
carykh-macro-rust-0.1.0 has been yanked.

A rust macro for finding strings that contain self-referential numbers. Inspired by carykh. This description contains twenty-seven words, fifty-four vowels, and ninety-nine consonants.

Usage

use carykh_macro_rust::{
    carykh_optimize, count_consonants, count_letters, count_vowels, count_words_of_length_n,
    has_n_letters,
};
use english_numbers::Formatting;

// This sentence has thirty-one letters.
let a = carykh_optimize!("This sentence has {} letters.", count_letters).unwrap();

// This sentence has twenty-two vowels and thirty-eight consonants. Hooray!
let b = carykh_optimize!(
    "This sentence has {} vowels and {} consonants. Hooray!",
    count_vowels,
    count_consonants
).unwrap();

// Number of words of each length in this bar graph:
// (three) two-letter-words,
// (three) three-letter-words,
// (five) four-letter-words,
// (eleven) five-letter-words,
// (eight) six-letter-words
let c = carykh_optimize!(
    "Number of words of each length in this bar graph:\n({}) two-letter-words,\n({}) three-letter-words,\n({}) four-letter-words,\n({}) five-letter-words,\n({}) six-letter-words",
    count_words_of_length_n(2),
    count_words_of_length_n(3),
    count_words_of_length_n(4),
    count_words_of_length_n(5),
    count_words_of_length_n(6)
).unwrap();

// Number of vowels and consonants in this mesmerizing pie chart:
// Vowels: Thirty-Four percent
// Consonants: Sixty-Six percent
let d = carykh_optimize!(
    "Number of vowels and consonants in this mesmerizing pie chart\nVowels: {} percent\nConsonants: {} percent",
    count_vowels,
    count_consonants;
    {
        formatting = Formatting::all(),
        condition = has_n_letters(100)
    }
).unwrap();