Last active
August 27, 2017 15:45
-
-
Save syedjafer/122e72565706db59ce5b5eb70714eab7 to your computer and use it in GitHub Desktop.
Matrix Rain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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