Solution (source code)

= Solution

For $0<t<1$, translated copies of the preceding pulse have disjoint interiors of support. In the cell $k-1/2\leq x<k+1/2$, write $r=x-k$. The solution is
$$
\boxed{u(x,t)=\begin{cases}(r+1/2)/t,&-1/2\leq r<t-1/2,\\1,&t-1/2\leq r<t/2,\\0,&t/2\leq r<1/2.\end{cases}}
$$
At $t=0$ use the given initial function. Each fan starts at $k-1/2$, and each shock has position $x=k+t/2$. At $t=1$, the plateau disappears: its left fan catches its right shock at $k+1/2$, which is also the starting edge of the next fan. The shocks must henceforth connect two nonconstant fan branches rather than a fan to a zero interval.