Created
December 8, 2012 17:50
-
-
Save RyanScottLewis/4241164 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RESET | |
+++++ +++++ set cell 0 to 10 (the multiplier) | |
[ run brackets until cell 0 == 0 | |
> +++++ +++ point to and set cell 1 to 8 * 10 = 80 | |
> +++++ +++++ ++ point to and set cell 2 to 12 * 10 = 120 | |
> +++++ ++++ point to and set cell 3 to 9 * 10 = 90 | |
> +++++ +++++ + point to and set cell 4 to 11 * 10 = 110 | |
<<<< - point to and cell 0 decrement 1 | |
] | |
> ++ . point to cell 1 increment 2 and print | |
> + . point to cell 2 increment 1 and print | |
> +++++ ++ . point to cell 3 increment 7 and print | |
> . point to cell 4 and print | |
<<<< point to cell 0 | |
clean up - loop through and set all cells to 0: | |
+++++ +++++ set cell 0 to 10 (the multiplier) | |
[ run brackets until cell 0 == 0 | |
> ----- --- point to cell 1 and decrement 8 | |
> ----- ----- -- point to cell 2 and decrement 12 | |
> ----- ---- point to cell 3 and decrement 9 | |
> ----- ----- - point to cell 41 and decrement 11 | |
<<<< - point to and cell 0 decrement 1 | |
] | |
> -- point to cell 1 decrement 2 | |
> - point to cell 2 decrement 1 | |
> ----- -- point to cell 3 decrement 7 | |
<<< point to cell 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://repl.it/ - Brainfuck