Skip to content

Instantly share code, notes, and snippets.

@TheLie0
Last active July 4, 2018 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheLie0/451ad81a40bedf549a4f05887132a9c1 to your computer and use it in GitHub Desktop.
Save TheLie0/451ad81a40bedf549a4f05887132a9c1 to your computer and use it in GitHub Desktop.
A brainfuck stack/heap memory emulator
+
[
>[<]
<[>,>]<
[
-----------------------------------------------------------> check if char is a semicolon
]<
[
+++++++++++ if its not a semicolon convert it into a number
>>
]
<<
]
] puts in numerical inout as numbers in memory
>>>>>>->[>] rectifies the weirdness of the above function
-[<]>
[>+[-<<]>[->++++++++++<]>] adds the decimals together to represent the input in one cell
<< rectifies the weirdness of the above function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment