Random knitting pattern generator

This Javascript will generate a random knitting pattern for you. It'll give you contiguous "patches" of knits and purls whose sizes, in either direction, are determined by Extremely Fancy Pseudorandom Number Generators. To be precise, as you follow the pattern along in either direction, the stitch has a probability (1/scale) of changing from k to p at each step. So, sometimes you'll have short runs before changing, sometimes you'll have long runs---the actual distribution of runs is called the Poisson Interval Distribution---but the most likely run is in the neighborhood of the "patchiness scale", which I've set to default to 5 but which you can make whatever you want.

Click on the "generate pattern" button to get the pattern in knitting notation. Click the "generate picture" button to get a crude view of your pattern with zeros and ones representing knits and purls. Have fun!

If you enjoyed this tool, please send a photo of the finished product to Ben Monreal at bmonreal@mit.edu. Feel free to modify it (click "view source" in your browser to see the source code) and reuse it in any way you please.


Number of rows:
Number of stitches per row:
Patchiness scale: