This animation demonstrates the construction of a square spiral. The logic is to add a system of kicks: at each vertex of the 4 sided growing spiral, increment the number of nodes to be added in the following vertex.
4