Maps a signed integer onto an unsigned one, keeping small magnitudes small.
static int zigzag(int value) => value < 0 ? -2 * value - 1 : 2 * value;