Last active
May 6, 2017 06:20
-
-
Save deanveloper/ef71fc2d9101d0eb6e6558b86852a9b2 to your computer and use it in GitHub Desktop.
This file contains 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
>+[ loop (add 1 so the loop executes; keep #0 = 0) | |
, take input | |
[->+>+<<] copy into next two cells | |
>> go to 2nd copy | |
[-<<+>>] move value to original cell; makes "origin" & "copy" | |
<----- ----- subtract 10 from copy | |
note: copy's value is not relevant; all that matters is that if it is 0 | |
(aka if the char was a newline) that it will break out of the loop! | |
this means that we can overwrite the copy with the next character; allowing | |
for the string to be stored neatly on the tape | |
] | |
< go to last inputted cell | |
[.<] keep outputting until the 0th cell is reached |
This file contains 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
>+[,[->+>+<<]>>[-<<+>>]<----------]<[.<] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment