Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Ecrire en couleurs aléatoire sur avenoel.org
- # Installez python 3
- # Ouvrez le programme avec IDLE
- # appuyez sur F5
- # tapez randcolor() pour avoir des couleurs random
- # tapez randcolor(1) pour avoir des couleurs random ET italique, gras, souligné, et barré random
- # tapez arcenciel() pour avoir un texte en arc en ciel avec des couleurs moches
- # tapez arcenciel([c1, c2, c3, ...]) pour changer le set de couleurs, en hexadécimal (de la forme 0xFFFFFF)
- # rentrez une chaine de caractère pour avoir la chaine avec les tags, puis copiez la chaine.
- # tapez /quit pour sortir
- # tapez sur CTRL + C pour arreter le programme
- # By Encephallus
- # Code cancer osef
- from random import randrange
- def randcolor(style = 0):
- tab = ['i', 'b', 'u', 's']
- while (1):
- string = input()
- if string == "/quit":
- return
- for i in string:
- r, g, b = map(lambda x: str(hex(randrange(x))), [0xFF]*3)
- balise = tab[randrange(4)]
- if style:
- print("<" + o + ">", end="")
- print("<color=#" + r[2:] + g[2:] + b[2:] + ">" + i + "</color>", end = "")
- if style:
- print("</" + o + ">", end="")
- print()
- def arcenciel(couleurs = 0):
- if not couleurs:
- couleurs = [0xd71d00, 0xf58c1d, 0xe6ff00, 0x00ff00, 0x52d7d0, 0x0b00ff, 0x4f007d]
- couleurs = list(map(lambda x: '<color=#' + str(hex(x))[2:] + '>', couleurs))
- n = len(couleurs)
- while (1):
- string = input()
- if string == "/quit":
- return
- for i in range(len(string)):
- print(couleurs[i % n] + string[i] + '</color>', end="")
- print()
Add Comment
Please, Sign In to add comment