Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Randomizing BBCode

Name: Anonymous 2011-08-09 9:58

https://gist.github.com/1132093

How can I improve this?

WARNING: FIOC

Name: Anonymous 2011-08-09 14:15

Tidied up your FIOC a bit, then rewrote most of it:

import random, sys
tags = 'b u i o sup sub spoiler m aa s'.split()

ransom = ''
for c in sys.stdin.read():
    amount = random.randint(0, 5)
    for tag in random.sample(tags, amount):
        c = '[{0}]{1}[/{0}]'.format(tag, c)
    ransom += c
print ransom

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List