walloftext/redcode.py

20 lines
332 B
Python
Raw Normal View History

2015-05-25 20:20:42 +02:00
from random import randint, choice
from sys import stdout
from time import sleep
RED='\033[31m'
GREEN='\033[32m'
YELLOW='\033[33m'
BLUE='\033[34m'
WHITE='\033[37m'
colors = [ RED, GREEN, GREEN ]
while True:
if randint(0,99) < 30:
stdout.write(choice(colors))
stdout.write('%X' % randint(0,15))
stdout.flush()
sleep(0.005)