Skip to content

Instantly share code, notes, and snippets.

@dela3499
Last active August 20, 2016 08:06
Show Gist options
  • Save dela3499/6c3164a6a644c06f8f54cf71c469dde9 to your computer and use it in GitHub Desktop.
Save dela3499/6c3164a6a644c06f8f54cf71c469dde9 to your computer and use it in GitHub Desktop.
Print large boolean matrix row by row in a terminal (looks like a scene from the matrix)
import time
import numpy as np
def g(t):
ti = 0
for _ in range(int(1e6)):
print ' '.join(np.random.randint(2, size = 80).astype(str))
time.sleep(np.random.random() * 0.05)
ti += 0.01
if ti > t:
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment