Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Takes in an undetermined amount of user input and echoes it back out once the user presses 'enter'.
- > ;moves one cell over to reserve the first cell
- + ;Makes cell positive so loop may start
- [
- , ;takes one char of user input
- [ ;loop: move input into a cell 2 cells to the right
- >>+<<-
- ]
- >> ;move back to the cell that data was moved to
- [ ;move the input from the holding cell and coppy it into both the origeonal cell and the one right after it
- <+<+>>-
- ]
- <---------- ;goes back one to the coppy of the origeonal cell and tests to see if its 10 (enter)
- ] ;if it is then loop will exit
- <---------- ;remove extra 10 (enter)
- <[<] ;go back to the first cell
- +[>.] ;print out all the cells
- <[[-]<] ;return all the cells back to 0
- Compact version of the script:
- >+[,[>>+<<-]>>[<+<+>>-]<----------]<----------<[<]+[>.]<[[-]<]
Advertisement
Add Comment
Please, Sign In to add comment