In an earlier challenge I asked code golfers to produce strings which copy each character in a string. For example:
TThhiiss iiss ddoouubbllee ssppeeaakk!!
This challenge is simply to detect if some text meets the definition of a double speak string.
- There is an even number of characters.
- When split into pairs, every pair consists of two of the same character.
- It's code golf, do it in few bytes.
- Use any language you choose.
- Please include a link to an online interpreter.
- The code will accept some text.
- For simplicity, the input will only consist of printable ASCII characters
- It will return an indication of whether or not the input is double speak. It could be:
- A boolean
- Strings ('true', 'false', 'yes', 'no' etc)
- Integers 0 or 1
- aba - false
- abba - false
- aabb - true
- aaabb - false
- tthhiiss - true
- ttthhhiiisss - false