Skip to content

Instantly share code, notes, and snippets.

@angrykoala
Last active July 11, 2017 10:15
Show Gist options
  • Save angrykoala/b44ccb1ccba60506a824 to your computer and use it in GitHub Desktop.
Save angrykoala/b44ccb1ccba60506a824 to your computer and use it in GitHub Desktop.
Easy and comprehensive example of Brainf*uck language
Easy and comprehensive example of Brainf*uck language
@angrykoala
Writes text
>++++++++[<+++++++++++>-]<-.
>+++[<+++++++++>-]<.
---------.
+++++++++++.
---------------.
>+++++++[<---------->-]<+.
>++++++++[<+++++++++++>-]<+.
----------.
++++++.
---.
>+++++++++[<--------->-]<-.
>++++++[<+++++++++++++>-]<.
-------------.
++++++++++++.
--------.
>++++++[<------->-]<-.
>+++++[<----->-]<-.
Cleans first byte
[-]
Reads Input
+[->,----------]<[+++++++++++<]>[>]
Writes Hello
[-]>[-]<
>++++++++[<+++++++++>-]<.
>++++[<+++++++>-]<+.
+++++++.
.
+++.
>++++++++[<---------->-]<+.
<[<] Returns to first byte
>[.>] Writes input
@angrykoala
Copy link
Author

This code can be stripped, resulting in:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment