Skip to content

W-h-a-t-s/Rant

 
 

Repository files navigation

Rant logo

Build status Build status

##What is Rant?

Rant is a language for procedurally generating text, written in C#. It combines a markup language with functional and imperative programming concepts to deliver a powerful, but easy-to-use tool for adding rich variations to your text. The ultimate goal of Rant is to augment your creativity with the boundless potential of randomness, helping you consider your next great idea as not just a static concept, but a seed for countless possibilities.

berkin.me/rant

##Features of Rant

  • Recursive, weighted branching with customizable selection strategies
  • Dictionary queries
  • Automation for capitalization, rhyming, and indefinite articles
  • Multiple output support
  • Richard, an experimental embedded scripting language
  • Probability modifiers
  • Loops, conditionals, and subroutines
  • Package loader for easy resource management
  • Unmanaged function exports for use in C/C++ applications (Windows only, sorry!)
  • Compatible with Unity
  • And a whole lot more!

##Examples

Fill in the blanks

<name-male> likes to <verb-transitive> <noun.s> with <pron.poss-male> pet <noun-animal> on <timenoun.s-dayofweek>.
Alick likes to mount shuttlecocks with his pet bat on Mondays.

Generate ten random numbers between 1 and 50 and spell them out

[case:sentence][numfmt:verbal-en][rep:10][sep:\s]{[num:1;50].}
Four. Ten. Thirteen. Fifteen. Eighteen. Twenty four. Seven. Forty eight. Nineteen. Twenty five.

Write a poem

[rhyme:perfect]
The <noun(1)::&a> <verb.ed(1)-transitive::&a> the <adj::&a> <noun(1)::&a>.
The bread fed the red head.
The drug dug the smug plug.

?????

[rs:16;\N]
{
    [r:50]{([rr])\u2593|([re])\s}
}
▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓ ▓▓▓▓   ▓    ▓       ▓ ▓          
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓ ▓ ▓▓▓ ▓            ▓         
▓▓▓▓▓▓ ▓▓▓▓▓ ▓ ▓▓▓ ▓ ▓  ▓ ▓▓▓▓ ▓▓ ▓   ▓           
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓ ▓  ▓  ▓    ▓▓   ▓▓  ▓▓         
▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓ ▓ ▓▓ ▓ ▓ ▓  ▓ ▓ ▓▓▓▓   ▓          
▓▓▓▓▓▓▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓ ▓  ▓  ▓▓                    
▓▓▓▓▓▓ ▓▓▓  ▓▓▓  ▓▓ ▓▓ ▓ ▓▓  ▓▓▓ ▓  ▓ ▓ ▓      ▓  
▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓    ▓▓  ▓▓ ▓▓▓▓ ▓▓▓  ▓            
▓▓▓▓▓▓▓▓▓▓ ▓▓▓   ▓▓▓▓▓▓▓ ▓▓                 ▓     
▓▓▓▓▓▓▓▓ ▓▓ ▓▓▓▓      ▓ ▓  ▓ ▓  ▓  ▓   ▓  ▓▓      
▓▓▓▓▓▓▓▓▓▓ ▓ ▓ ▓▓ ▓ ▓▓▓▓▓▓▓ ▓      ▓   ▓          
▓▓▓▓▓▓▓▓▓▓ ▓  ▓▓   ▓▓▓   ▓▓▓▓▓     ▓ ▓▓           
▓▓▓▓ ▓▓▓▓▓▓▓ ▓▓▓ ▓  ▓▓▓ ▓    ▓     ▓    ▓         
▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓   ▓ ▓▓ ▓▓▓   ▓▓        ▓     
▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓  ▓▓▓ ▓▓ ▓▓   ▓      ▓ ▓ ▓        
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓  ▓▓     ▓    ▓       ▓▓▓ ▓      

##NuGet Rant is also available as a NuGet package. Punch the following into your package manager console and smash the Enter key enthusiastically to get it:

PM> Install-Package Rant

Or if development builds are your thing:

PM> Install-Package Rant -Pre

But remember, the latest version will always be available on the repository first.

##License Rant is provided under The MIT License.

##Improve Rant If there is something you want fixed, added, or changed, feel free to submit an issue/pull request. You are welcome to help with any of the following:

  • Documentation
  • Fixing bugs
  • Optimization
  • New functions
  • New language features
  • Improving old language features
  • New API features
  • Formatting support for other cultures

##Learn Rant See berkin.me/rantdocs for full documentation of the API and Rant language, as well as additional example code.

##Support Rant If you love my work and want to support it by donating, you can do so here. Donating isn't required, but it's much appreciated!

##Other projects If you like Rant, you may also like these other, Rant-related projects:

  • RIDE: The official (and highly WIP) Rant IDE
  • Rantionary: The official Rant dictionary

:squirrel:

About

The Rant Procedural Text Generation DSL

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.7%
  • Other 0.3%