User:Lobstopus/Sandbox

I won't make these full pages until I've written an implementation. Or someone else does.

Definition
This is an attempt to make a form of Brainf*** with encrypted source, similar to a very simple Malbolge. I failed to make it significantly harder to write programs in, but at least the programs are shorter.

To encrypt a Brainf*** program: However, the encrypted form of the source must entirely consist of printable characters (codes 32-126 inclusive). So (+++++++) becomes "$I" followed by Special Character #18 (Device Control 2); thus, it is invalid. Since 3-bit commands become 7-bit characters, that means that each group of 7 commands becomes 3 characters. This means that a program can be written 7 commands at a time, but it also means that each group of commands must contain exactly 7 things. Hence, there are two restrictions imposed by the encryption:
 * 1) Convert each of the commands to a 3-bit number in binary (with each of (><+-.,[]) equalling 000, 001, 010, etc. respectively).
 * 2) Concatenate the commands into a bit-string.
 * 3) Split the bit-string into groups of seven, and interpret these as ASCII characters.
 * Some combinations of commands are invalid, e.g. (+++++++), which must be written as (++++-++) for reasons that will become clear later. Note that this actually increments the current cell 5 times, which brings us to the next restriction:
 * Each group of commands must contain exactly 7 things, e.g. (++++.), which must be written (++++-+.).

Programming in Cryptf***
Suppose I wish to write an encrypted command which increments the current cell as many times as possible: + +   +  +  +   +  + 0100100 1001001 0010010 $       I       DC2 This does not entirely consist of printable characters, so we must change it somehow. In fact, there is a simple way for fixing a command sequence: since the first two bits of a character are 64 and 32, and a character is printable if it is >=32 and <=126, we can make a character printable by making one of the first two bits 1. Hence: + +   +  +  -   +  + 0100100 1001001 1010010 $       I       R This increments the current cell 4-1+2=5 times, which is the maximum possible with a single triple of encrypted characters.

Here are some "useful" triples: Increment current cell 5 times: +++++  = ++++-++ = $IR Set current cell to 0:         [-]     = [-]+--+ = giZ (among others) Output current cell:. = .+++--- = DI[ (among others) Decrement current cell 7 times: ---          = 6m[ In fact, for each Brainf*** command, there exists a large number of different triples that are equivalent, mostly beginning with a variation of (+-+-+-), so it sadly is trivial to encrypt a program, though decryption is not.

The Hello World program
There may be a shorter version than this, but here is an encrypted version of the shortest Brainf*** Hello World program. $IR$IR`IR$IP$IR$IR&iP$AR4$KpIT4MP(IR$ITDIT&%R$IR$IR$IT4h"$iT6m\6m[8A DI[ I wonder how one would go about finding a minimal Hello World program?

Introduction
This is a definition of mugh brains. It makes use of zombie and civilian actors, which aren't really actors (just syntactic salt).

There are four variable types:
 * 1) Zombies, who hold variables and act on them.
 * 2) Civilians, who create variables.
 * 3) Flesh, which holds one int32 value.
 * 4) Brains, which are int32 stacks.

More information:
 * Case-insensitive (uses all-lowercase)
 * Commands separated by newlines (spacing is important!)
 * Zombies are "require host to be dead"-type (not that that makes a difference)

Input moans
I tried my best, here and below, to recreate the style of famous zombie moans, and the original example program.

To make it easier for the programmer to make it look good, there are several possible moans for each possible digit.

For example, 619 could be "gaahoarb", "gaahoarurr", "gaahgrurr", "aahgoarb", "aahgoarurr", etc.

Processing moans
Here, "Top" refers to the top value (if targetting brains) or just the value (if targetting flesh). "a" is the argument.

Sample programs
Hello World program: zombie napoleon civilian batman kill batman get batman's brains gurr hraah garghargh goarargh goahurr aahgragh goahagh hrugh groar aahgragh goarargh aahgrargh garghoar gaahugh eat brains