私は iPhone ユーザーなので Android のスクリーンロックはほとんど使ったことがないのだけど、
#!/usr/bin/python BLOCKERS = {(1, 3): 2, (1, 7): 4, (1, 9): 5, (2, 8): 5, (3, 1): 2, (3, 7): 5, (3, 9): 6, (4, 6): 5, (6, 4): 5, (7, 1): 4, (7, 3): 5, (7, 9): 8, (8, 2): 5, (9, 1): 5, (9, 3): 6, (9, 7): 8} def fingerlist(selected = ()): if len(selected) >= 4: yield selected for i in set(range(1, 10)) - set(selected): if len(selected) > 0: transit = (selected[-1], i) if transit in BLOCKERS and BLOCKERS[transit] not in selected: continue for p in fingerlist(selected + (i,)): yield p for p in fingerlist(): print p