Solution (source code)

= Solution

For a closed piecewise continuously differentiable <path> avoiding $a$, the <winding number> is
$$
\boxed{n(\gamma,a)=\frac1{2\pi i}\oint_\gamma\frac{dz}{z-a}=\frac1{2\pi i}\int_0^1\frac{\gamma'(t)}{\gamma(t)-a}\,dt.}
$$
Break the parameter interval at the finitely many derivative discontinuities when evaluating this integral. Translating the curve gives $n(\gamma,a)=n(\gamma-a,0)$, which will also be used below.