The depth parameter controls how many previous characters each character depends upon. For example, if depth = 0 then each character is chosen independently of all the rest. If depth = 4, then each character is chosen according to the conditional distribution given the most recent 4 characters.
This program will generate 3000 random characters. The program is quite large and takes 10-30 seconds to run, so be patient.