""" Neil, 2022 Toy program to illustrate using a random number generator (a dozen monkeys pounding the keys of a typewriter!?) to find the complete works of Shakespeare (or just your name) """ import numpy as np # you can access numpy's random generator as methods (eg. np.random.xxxxxx()) nsamples = 1000000 # this is the number of random samples we want Q = np.random.randint(65,91,nsamples) # this is a uniform random integer generator neil = [78,69,73,76] # as an example, this is my name in ASCII code for i in range(len(Q)-len(neil)): if Q[i] == neil[0] and Q[i+1] == neil[1] and Q[i+2] == neil[2] and Q[i+3] == neil[3]: print(" 'NEIL' found at index ",i) print(Q[i:i+4]) break