Skip to content

Instantly share code, notes, and snippets.

@syedjafer
Last active August 27, 2017 15:45
Show Gist options
  • Save syedjafer/122e72565706db59ce5b5eb70714eab7 to your computer and use it in GitHub Desktop.
Save syedjafer/122e72565706db59ce5b5eb70714eab7 to your computer and use it in GitHub Desktop.
Matrix Rain
import time,random
items = [chr(i) for i in range(0x30a1, 0x30ff + 1)] # katakana
for i in range(1,11): # spaces and numbers
items.append(str(i))
items.append(" "*i)
def rain(row,column): # rows,columns
for i in range(row): #for every row
s = '' #new string
for j in range(column): #for every column (or character)
ri = random.randrange(len(items)) #random index
s += items[ri]
print(s)
time.sleep(0.05) # change this to whatever makes the rain a good speed
rain(100,100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment