Skip to content

Instantly share code, notes, and snippets.

@luizperes
Created December 9, 2016 01:50
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 luizperes/6a5f9f21f620a5d47f9bcc50a068f403 to your computer and use it in GitHub Desktop.
Save luizperes/6a5f9f21f620a5d47f9bcc50a068f403 to your computer and use it in GitHub Desktop.
this code stops when the user presses the 'q' key
the only chars accepted are the brain chars | tabs and spaces
+ add one to the 0th cell to start the while
[ while (true)
, read input at 1st cell
>[-] clean 2nd cell
make letter 'q' before copying at 3rd cell
++++++++++>+++++++++++*+++
<[-] go back to 2nd cell and clean it
+* copy value from 1st to 2nd cell
>% go to 3rd cell mod 2nd cell
?
[-]<< if the value is not zero clean the cell and move to 1st cell
:
!
;
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment