This Quora thread contains some interesting breakdowns of the number of possible patterns that Android permits.
https://www.quora.com/Android-operating-system-How-many-comb...
If we assume that you don't know the number of points in use on a phone you're trying to unlock, the consensus seems to be there are in the region of 390,000 distinct patterns. One correspondent doubled that.
In the case where you know the pattern has 4 points, the number of valid permutations was calculated to be 1624. Your 22 attempt crack is well short of that figure so I think you are being harsh on yourself by implying you basically just got lucky. You're good at this!
0 1 2
3 4 5
6 7 8
Then an L shaped pattern would be the string 0367.
The main idea is that you first build a list of every possible combination of legal moves. Then you take a random guess from that list and you will get back the number of white and black dots.
Now, since you know your random guess and the right answer produces X white dots and Y black dots, you can remove from the list of possible combinations every combination that has: dots(myGuess, combinations[i]) != (X, Y)
you can keep taking random guesses from this list and filtering after each attempt until you get the right answer, I'm not sure of the math but I think worst case It'll be 6-7 moves to find the right answer.
After you excluded all "bad" nodes, you need to find the order. finding the order with the help of "bad" nodes was also faster for me
I went from 56 to a lucky 5 tries.
only 49 tries for me. lol