static num pingPong<T extends num>(T x, {int length = 1}) { return length - Math.abs(x % (length * 2) - length); }