Zigzag Bytes
A challenge by
MeWhenI
Description
A string zigzags if its bytes go up, then down, then up, then down again, and so on…
Note that a zigzag can start with a zig or a zag (an increase or a decrease).
Here are some strings that zigzag:
1212 2121 xyxyx 13254 SwApCaSeFuNnY z!g zag >:^)
Here are some strings that don’t zigzag:
1232 1221 zigzag !!!!!!
Write a program which outputs all lines from the input which zigzag. Your program must also zigzag.
NOTE: Each line will consist of 4-50 bytes of printable ASCII.
Leaderboard
| Author | Points | ||
|---|---|---|---|
| #1 |
|
MeWhenI | 161 |
| #2 |
|
hallvabo | 189 |
| #3 |
|
BrunoVisnadi | 211 |