Wolfram Research

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

TranslationOptions has the following build-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
Per Wikipedia, this is a minimalist, esoteric programming language that uses just eight characters.

Examples

Basic Examples

Generate a code:

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

Run to verify this code:

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

Scope

The output is assumed to be UTF8 encoded, which can support all Unicode characters:

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

Verify this code:

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

Options

TranslationOptions

Specify a dialect, such as 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]=

Resource History

Source Metadata

Related Resources