ambrosiaforest@lemmy.blahaj.zone to 196@lemmy.blahaj.zone · 9 months agofixed rulelemmy.blahaj.zoneimagemessage-square99fedilinkarrow-up1570arrow-down10file-text
arrow-up1570arrow-down1imagefixed rulelemmy.blahaj.zoneambrosiaforest@lemmy.blahaj.zone to 196@lemmy.blahaj.zone · 9 months agomessage-square99fedilinkfile-text
minus-square7heo@lemmy.mllinkfedilinkarrow-up1·edit-29 months agoBrainfuck, but with parentheses only. > ))) < ((( + ()) - (() . ()( , )() [ )(( ] ))( Hello world example: ()))(((()(())))(())(())))))()))))(() (()(()(()(()(((((())(((((()(()((((() (()(()))()))(()()()))))))))())()())) )))()(()(())())()))((()()))))((((((( ((((((()(())())())()((()(()(()(()(() (()()((((((((()()())))))))))))())()( Python transpiler: #!/usr/bin/env python from sys import stdin OPS = { ")))": '>', "(((": '<', "())": '+', "(()": '-', "()(": '.', ")()": ',', ")((": '[', "))(": ']' } def main(): _d = ''.join(stdin.readlines()).rstrip('\n') for _op in [_d[x:x+3] for x in range(0, int(len(_d)), 3)]: print(OPS[_op], end='') if __name__ == "__main__": main()
Brainfuck, but with parentheses only.
Hello world example:
Python transpiler:
#!/usr/bin/env python from sys import stdin OPS = { ")))": '>', "(((": '<', "())": '+', "(()": '-', "()(": '.', ")()": ',', ")((": '[', "))(": ']' } def main(): _d = ''.join(stdin.readlines()).rstrip('\n') for _op in [_d[x:x+3] for x in range(0, int(len(_d)), 3)]: print(OPS[_op], end='') if __name__ == "__main__": main()