Function Repository Resource:

BrainLanguageEncode

Source Notebook

Encode a string into brain language code

Contributed by: Aster Ctor

ResourceFunction["BrainLanguageEncode"][string]

Encode string into brain language code.

Details and Options

Per Wikipedia, Brainf*** (the last three characters have been modified to remove offensive content) is a minimalist, esoteric programming language that uses just eight characters.
TranslationOptions has the following built-in dialect encoding:
"Normal"do not make any extra escaping
"Refined"remove all white space and newline
"Octal"use octal digit encoding
"Chinese"encode using "右左增减始终写读"
"Dao"encode using "☴☳☱☶☰☷☲☵"
"周易"encode using "巽震兌艮坤乾離坎"
"Ook"encode using the esoteric language Ook

Examples

Basic Examples (2) 

Generate a code:

In[1]:=
en = ResourceFunction["BrainLanguageEncode"]["wolfram"]
Out[1]=

Run with the resource function BrainLanguageEvaluate to verify this code:

In[2]:=
ResourceFunction["BrainLanguageEvaluate"][en]
Out[2]=

Scope (2) 

The output is assumed to be UTF-8 encoded, which can support all Unicode characters:

In[3]:=
jp = ResourceFunction["BrainLanguageEncode"]["こんにちは世界"]
Out[3]=

Verify this code with the resource function BrainLanguageEvaluate:

In[4]:=
ResourceFunction["BrainLanguageEvaluate"][jp]
Out[4]=

Options (2) 

TranslationOptions (2) 

Specify a dialect, such as the esoteric language Ook:

In[5]:=
ResourceFunction["BrainLanguageEncode"]["wolfram", TranslationOptions -> "Ook"]
Out[5]=

Another dialect, using octal digit encoding:

In[6]:=
ResourceFunction["BrainLanguageEncode"]["wolfram", TranslationOptions -> "Octal"]
Out[6]=

Publisher

Aster Ctor (MoeNet)

Version History

  • 1.0.0 – 16 December 2019

Related Resources

Author Notes

Implemented 100% in The Wolfram Language, so no Python environment is required.

License Information