It's a very nice example.
The horizontal distance x is divided into n equal parts.
The vertical distance x is also divided into n equal parts.
Hence the distance travelled, for any number of subdivisions n is
You will always know the distance travelled,
however, if n is very large,
another observer may not spot the divisions for extremely large n
and conclude that the distance travelled is the straight diagonal.