Keyboard Ping Pong
(This question was inspired by this post.)
Challenge
Given a string of letters, determine if the word "ping-pongs" across the keyboard. (Letters alternating between sides of the keyboard)
Use any established Latin-script keyboard layout that you would like (QWERTY, AZERTY, etc.) but please specify your choice in your answer.
Here is a graphic of the ping pong sides with QWERTY layout. The left hand side consists of the leftmost 5 letters, with the right hand side consisting of the remaining letters.
Test Cases (QWERTY)
skepticism - true
ENDOWMENT - true
quantity - true
dispel - true
kayaks - true
a - true
aa - false
test - false
WRONG - false
thiswillfail - false
ε - false
Comments:
- Strings of length
1
should return true. Represents an ace! - Strings of length
0
should return false. A point would not be scored in a real ping pong game. - Should be case-insensitive
This question is tagged code-golf, so the shortest answer in bytes wins!
QWERTASDFGZXCVB
and other letters, ignoring case." \$\endgroup\$