One aspect of password strength testing is runs of adjacent letters on the keyboard. In this challenge, a program must be created that returns
true if a string contains any runs of adjacent letters.
What counts as a run of adjacent letters?
For this simplified version of a password strength tester, a run of adjacent characters is 3 or more letters which are next to each other in a single direction (left, right, above or below) on a QWERTY keyboard. For the purpose of this challenge the layout of the keyboard looks like this:
1234567890 QWERTYUIOP ASDFGHJKL ZXCVBNM
In the diagram above
Q is below
1 but not below
2, so a string that contains
aq1 anywhere inside it would make the program return
2qa would not.
The password string to check. It will only contain the characters
[0-9A-Z] (your choice).
The program must return a truthy value if the password contains one or more runs of adjacent keys, or falsey if it contains none.
The following inputs should output true:
And these inputs should output false:
- Answers may be complete programs or functions.
- Standard loopholes are disallowed.
- This is code-golf, lowest score (in bytes) wins!