Das ist eben aus langeweile entstanden
Code
- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- bfsource = str(raw_input('Brainfuck sourcefile: '))
- try:
- file = open(bfsource, 'r')
- except:
- print '[!] Error while opening file'
- bf = file.read()
- file.close()
- output = ''
- for char in bf:
- if char == '+':
- output += 'Ook. Ook. '
- elif char == '-':
- output += 'Ook! Ook! '
- elif char == '>':
- output += 'Ook. Ook? '
- elif char == '<':
- output += 'Ook? Ook. '
- elif char == '[':
- output += 'Ook! Ook? '
- elif char == ']':
- output += 'Ook? Ook! '
- elif char == '.':
- output += 'Ook! Ook. '
- elif char == ',':
- output += 'Ook. Ook! '
- else:
- continue
- file = open('Ook', 'w')
- file.write(output)
- file.close