Skip to content

Instantly share code, notes, and snippets.

@StoneCypher
Created December 24, 2013 03:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StoneCypher/8108308 to your computer and use it in GitHub Desktop.
Save StoneCypher/8108308 to your computer and use it in GitHub Desktop.
what the 💩 is this damnit john

ErlangChopra

... because David needed his very own text generator, and we know he likes RDCQG.

The code

Starts     = ["Experiential truth ", "The physical world ", "Non-judgment ", "Quantum physics "].
Middles    = ["nurtures an ", "projects onto ", "imparts reality to ", "constructs with "].
Qualifiers = ["abundance of ", "the barrier of ", "self-righteous ", "potential "].
Finishes   = ["marvel.", "choices.", "creativity.", "actions."].

RF = fun(X) -> sc:random_from(X) end.

ErlangChopra = fun() -> RF(Starts) ++ RF(Middles) ++ RF(Qualifiers) ++ RF(Finishes) end.

Using it:

Erlang R16B (erts-5.10.1) [smp:4:4] [async-threads:10]

Eshell V5.10.1  (abort with ^G)

1> Starts = ["Experiential truth ", "The physical world ", "Non-judgment ", "Quantum physics "].
["Experiential truth ","The physical world ","Non-judgment ", "Quantum physics "]

2> Middles = ["nurtures an ", "projects onto ", "imparts reality to ", "constructs with "].
["nurtures an ","projects onto ","imparts reality to ", "constructs with "]

3> Qualifiers = ["abundance of ", "the barrier of ", "self-righteous ", "potential "].
["abundance of ","the barrier of ","self-righteous ", "potential "]

4> Finishes = ["marvel.", "choices.", "creativity.", "actions."].
["marvel.","choices.","creativity.","actions."]

5> RF = fun(X) -> sc:random_from(X) end.
#Fun<erl_eval.6.17052888>

6> ErlangChopra = fun() -> RF(Starts) ++ RF(Middles) ++ RF(Qualifiers) ++ RF(Finishes) end.
#Fun<erl_eval.20.17052888>

7> ErlangChopra().                                                               
"Quantum physics imparts reality to self-righteous actions."

8> ErlangChopra().
"Quantum physics constructs with self-righteous creativity."

9> ErlangChopra().
"Non-judgment imparts reality to abundance of marvel."

10> ErlangChopra().                                                              
"The physical world projects onto the barrier of choices."

11> ErlangChopra().
"The physical world projects onto self-righteous creativity."

12> ErlangChopra().
"Non-judgment imparts reality to potential choices."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment