Skip to content

Instantly share code, notes, and snippets.

@BigBri92
Last active August 30, 2017 00:30
Show Gist options
  • Save BigBri92/5767609 to your computer and use it in GitHub Desktop.
Save BigBri92/5767609 to your computer and use it in GitHub Desktop.
Little script I wrote to make a mock matrix in command line
# Enter The Matrix
import os, time, msvcrt, random
os.system('color 07')
os.system('cls')
x = [1, 2, 3, 4, 5, 6, 8,
15, 20, 21, 32, 32, 32, 32,
32, 33, 35, 36, 37, 38, 48,
48, 48, 49, 49, 49, 63, 64]
while True:
i = raw_input('Are you ready to enter the matrix? (Y or N): ').lower()
if i == 'y':
os.system('color 02')
while True:
try:
for c in xrange(50):
print '%c'% random.choice(x),
time.sleep(0.075)
if msvcrt.kbhit() and ord(msvcrt.getch()):
os.system('color 07')
os.system('cls')
print 'Goodbye Neo'
time.sleep(1)
raise SystemExit
except KeyboardInterrupt:
os.system('color 07')
os.system('cls')
print 'Goodbye Neo'
time.sleep(1)
raise SystemExit
elif i == 'n':
os.system('cls')
print 'Come back when you are ready'
time.sleep(1)
raise SystemExit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment