ShadyAsFuck

From Esolang
Jump to navigation Jump to search

ShadyAsFuck is a language develped by PPCG users VTCAKAVSMoACE and flawr in the night from October 9th to October 10th 2015. It is substitution encoding of BrainFuck. But instead of a one to one encoding, two BrainFuck commands are encoded in one ASCII character in order to make it more memory efficient and more suitable for golfing, as it uses 72 characters instead of only 8.

The substitution works as follows: The whole source code is split up in pairs, each pair will be replaced by a new character according to the following table. The first character determines the row, the second character determines the column. The last column is made for programs that have an odd number of BrainFuck commands. But these characters can also be used in the middle of ShadyAsFuck code. This column also ensures that BrainFuck code also works in ShadyAsFuck without substitution.

+ - < > [ ] , . [none]
+ P O s h a d y _ +
- 0 M A S f u c k -
< n G L x Y p Q J <
> g m o R 5 e U 2 >
[ j 3 b z { ( I V [
] W E B = ) } Z T ]
, t H i N K ! ; C ,
. F l 4 w r X D : .


Note: Interestingly, because of the syntax for having nothing as the second command, one can even run Brainfuck codes through ShadyAsFuck.

This table is carefully chosen, as it contains important information even without the context of the subsitution. There are in fact choices that were made for user friendliness, mainly the characters on the diagonal as well as on the sub/super diagonals:

BF  SAF  crib
++  P    Plus
--  M    Minus
<<  L    Left
>>  R    Right
[[  {    left brace
]]  }    right brace
..  :    two dots
,,  ;    two commas

-+  0    useless
+-  O    useless
><  o    useless
<>  x    useless
[]  (    open parenthesis (only used in very particular situations)
][  )    closed parenthesis
,.  C    cat (reads one char and outputs)
.,  D    dog (opposite of cat)

An example of Hello World:

PPPPzPPzPgPgPgLLuggmRapG=2mMFPPP:P_R4kJP_MMMlMMMkR_g_

Which, in brainfuck, is:

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

External resources