Byte Heist Home Leaderboard
Join the Heist (with Github)
Solve View

Zigzag Bytes

A challenge by MeWhenI avatar 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 Score
#1 MeWhenI avatar MeWhenI 581
JavaScript (Deno) JavaScript (NodeJS) Python Rust C (tcc) APL (TinyAPL) Vyxal Vyxal 3
You must be logged in to submit a solution.