Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Answer should be 1 to 255
- ,[ take INPUT and begin main loop; process until EOF
- >+++++[>++++++++<-] insert 40 "(" into memory (MEM: INPUT _TMP_ 40 ACC)
- >[-<<->>]<< subtract 40 from INPUT and go there
- [>>>--<<<[-]] if INPUT not 0: subtract 2 from ACC and zero INPUT
- >>>+<<< if we skipped inc ACC; otherwise ACC ends up decremented
- , read some more input
- ] loop continues until we hit EOF
- >>>+ move over to ACC and add one for the newline
- print integer function (copied from the internet)
- [>>+>+<<<-]>>>[<<<+>>>-]<<+>[<->[>++++++++++<[->-[>+>>]>[+[-<+>]>+>>]<<<<<]>[-]
- ++++++++[<++++++>-]>[<<+>>-]>[<<+>>-]<<]>]<[->>++++++++[<++++++>-]]<[.[-]<]
- ++++++++++.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement