Skip to content

Instantly share code, notes, and snippets.

@KIVagant
Created May 6, 2020 17:55
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 KIVagant/8182239cf07838d321c608c0ae137e4a to your computer and use it in GitHub Desktop.
Save KIVagant/8182239cf07838d321c608c0ae137e4a to your computer and use it in GitHub Desktop.
Brainfuck example: yes-no dialogue (if-else condition)
//
// Use the following resources to play with your code:
//
// - http://bf.doleczek.pl One of the best interpreter.
// - https://fatiherikli.github.io/brainfuck-visualizer/ Amazing visualizer to understand the logic (but too slow for big examples)
// - https://copy.sh/brainfuck/text.html Text-to-brainfuck transformer to generate strings
//
// Put here a question text generated in https://copy.sh/brainfuck/text.html.
// The question MUST expect "y" (yes, yeah, y**whatever) as the proper answer.
// And anything else means "no".
[-]
,>++++++++++++[<---------->-]<-
>+<
[>-<[-]
// Put here a generated text for "no" answer (https://copy.sh/brainfuck/text.html)
[-]>[-]<]
>
[[-]
// Put here a text for "yes" answer https://copy.sh/brainfuck/text.html.
[-]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment