All code necessary to determine possible dot patterns from my blog post at http://www.austinstory.com/pattern-lock-passwords-not-as-many-choices-as-you-would-think/
Just copy the code into your ruby folder.
Pattern.work(x) Determines the dot patterns possible from 2..x. So would if x is 6, it would spit out 2, 3, 4, 5 and 6
Pattern.determine_routes(x) Determines the results from a single dot pattern.