Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Pass programs to these functions in the form of strings. wf_bf will accept Wordfuck and return Brainfuck while bf_wf
- #will accept Brainfuck and return Wordfuck, generated with a list of random words.
- def words(s):
- result,z=[],s
- while len(z)>0:
- try:
- x=z.index(' ')
- result.append(z[:x])
- z=z[x+1:]
- except:
- result.append(z)
- z=''
- for i in result:
- if i=='':
- result.remove(i)
- return result
- def wf_bf(s):
- table={2:'.',3:'-',4:'+',5:',',6:'>',7:'<',8:'[',9:']'}
- z=words(s)
- result = ""
- for i in z:
- if len(i) in [2,3,4,5,6,7,8,9]:
- result+=table[len(i)]
- return result
- def bf_wf(s):
- from random import choice
- randomwords=[['it', 'to', 'is', 'or', 'be', 'ye', 'so', 'me', 'he', 'pi', 'do', 'we', 'my'], ['not', 'man', 'and', 'ore', 'try', 'men', 'the', 'you', 'was', 'can', 'bat', 'dry', 'dog', 'ran', 'nor', 'cat', 'thy', 'pit', 'bin', 'box', 'rat', 'mat', 'fat', 'hat', 'ham', 'dam', 'fan', 'joy', 'tin', 'toy', 'gag', 'pan', 'pad', 'pin', 'cry'], ['dart', 'that', 'list', 'once', 'fish', 'leaf', 'pine', 'grin', 'cola', 'loop', 'colt', 'plan', 'pore', 'play', 'nick', 'dent', 'lick'], ['mouse', 'among', 'spike', 'woman', 'women', 'brain', 'novel', 'there', 'named', 'sloth', 'zebra', 'throw', 'foyer', 'lucky', 'horse', 'block', 'truck', 'canal', 'radio', 'break', 'biome'], ['roller', 'sailor', 'botany', 'bonobo', 'portal', 'pocket', 'tactic', 'jumped', 'remote'], ['octopus', 'cranium', 'blanket', 'filings', 'bemused', 'machine', 'sawdust', 'gymnast', 'beastly', 'testify', 'dubious', 'coastal'], ['question', 'critical', 'hospital', 'trifling', 'alphabet', 'lodgings', 'imposter', 'screamer', 'apparent', 'omnivore', 'dramatic', 'dissolve', 'ordinary', 'syllable', 'humanity', 'hydrogen'], ['limousine', 'enlighten', 'vengeance', 'furniture', 'candlelit', 'predicted', 'apathetic', 'statuette', 'climactic', 'allergens', 'dexterity', 'versatile']]
- table={'.':2,'-':3,'+':4,',':5,'>':6,'<':7,'[':8,']':9}
- result=""
- for i in s:
- if i in '><+-.,[]':
- result+=choice(randomwords[table[i]-2])+" "
- return result[:-1]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement