Last active
August 20, 2016 08:06
-
-
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)
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 | |
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