# Brainfuck to Unary converter(well, in part) v.0.1def unaryconvert(): source = raw_input(">") #prompt for entering code z = "1" #make sure output starts with a 1 for y in range(0, len(source)): code_input = source[(y):(y+1)] #process a single character at a time if code_input == ">": #elif sequence to add binary numbers z += "000" elif code_input == "<": z += "001" elif code_input == "+": z += "010" elif code_input == "-": z += "011" elif code_input == ".": z += "100" elif code_input == ",": z += "101" elif code_input == "[": z += "110" elif code_input == "]": z += "111" else: break #if a non-BF character is encountered, stop print z #print the binary numberif __name__ == "__main__": unaryconvert()