mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 08:32:32 +00:00
18 lines
363 B
Python
18 lines
363 B
Python
import random
|
|||
|
|
|
||
|
|
def makeRainbow(word):
|
||
|
|
|
||
|
|
word = word or "RAINBOW"
|
||
|
|
output = ""
|
||
|
|
rb = ["5","7","8","3","12","13","6"]
|
||
|
|
bg = "01"
|
||
|
|
idx = random.randrange(0, len(rb))
|
||
|
|
|
||
|
|
for l in word:
|
||
|
|
if l == " ":
|
||
|
|
output += ' '
|
||
|
|
else:
|
||
|
|
output += "\x03" + rb[idx % len(rb)] + "," + bg + l
|
||
|
|
idx += 1
|
||
|
|
|
||
|
|
return output
|