b̶r̶a̶i̶n̶fuck

From Esolang
Jump to navigation Jump to search

Brainfuck is a pretty good esolang, but you can't use it without a brain. This is a bad esolang, but you don't need a brain to use it.

Introduction

This is an esolang designed by User:None1, for unbrained people and non-humans, but people with brains can still use it quite easily.

Execution

This esolang has only one command, which is the increment command +.There is also only one 8 bit cell.

When the program runs, it runs all the + commands (other characters are ignored), and prints the resulting cell value as ASCII.

Example Programs

Print A

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Interpreters

Note that the Python interpreter outputs an extra line feed, if you don't want that, you can add ,end="" before the last ).

C

#include<stdio.h>
int main(){
    char c,x=0;
 .  while((c=getchar())!=EOF){
        if(c=='+') ++x;
    }
    putchar(x);
    return 0;
}

Python

print(chr(__import__("sys").stdin.read().count("+")%256))

brainfuck

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

The program is generated using BFFuck, which is a brainfuck code generator. A much shorter one:

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

Inteprets the whole program.

><>

>i:01-=?v00.
v &0 r+1<
>:"+"=?!v&v
  ;o&v?:< 1
^   ~<  &+<

A more optimized version:

0&01. >&n;   >&1+&01.
>i:0(?^:"+"=?^

See also