Loading design...

A beautiful the matrix binary code created with Python Turtle. Read the code below, copy it, and try it in your own Python environment.
from turtle import *
import random
setup(width=800, height=600)
bgcolor('black')
tracer(50)
hideturtle()
chars = '01010101010101010101010101010101010101010101010101010101010101010101'
num_columns = 40
turtles = []
font = ('Courier', 14, 'normal')
for i in range(num_columns):
t = Turtle()
t.hideturtle()
t.penup()
t.color('green')
x = -380 + i * 20
y = random.randint(-300, 300)
t.goto(x, y)
turtles.append(t)
def move_rain():
for t in turtles:
char = random.choice(chars)
t.write(char, align='center', font=font)
y = t.ycor() - 20
if y < -300:
y = 300
t.goto(t.xcor() + random.randint(-5, 5), y)
t.color(random.choice(
['green','lime green', 'forest green']))
t.goto(t.xcor(), y)
update()
ontimer(move_rain, 100)
move_rain()
done()