Golunar

From Esolang
Jump to navigation Jump to search

Golunar is a derivative of Unary, which is itself a derivative of Brainfuck. It is thus even further removed from usability. Golunar was derived by Peter Berg in 2013. The name is a mix of "Unary" and "logarithm."

Instructions

A valid Golunar program is constructed by writing, in decimal, the number of zeroes in the equivalent Unary program.

Examples

Program that gets a single character and outputs it again

108

Cat program, EOF returns 0

56623

Translator

The following shell script can be used to convert from brainfuck to Golunar. For best results, it should be run as BC_LINE_LENGTH=0 sh bf2gl.sh FILE.

bf='><+\-.,[]'
echo "ibase=2; 1`cat $1 | tr -cd $bf | tr $bf '\0-\7' | xxd -b -c1 | cut -d\  -f2 | sed s/00000// | paste -sd '\0'`" | bc