u_0 = Point(xAxis)
n = 16 (slider from 0 to 40, step 1)
n1: floor(n / 4.0)
f(x) = sqrt(x)
u_n = IterationList(f, x(u_0), n1 + 1.0)
n2 = Mod(n, 4.0)
list1 = Sequence(Segment[(Element[u_n, i], 0.0), (Element[u_n, i], Element[u_n, i + 1.0])], i, 0.0, If[n2 > 0.0, n1 + 1.0, n1])
list2 = Sequence(Segment[(Element[u_n, i], Element[u_n, i + 1.0]), (0.0, Element[u_n, i + 1.0])], i, 0.0, If[n2 > 1.0, n1 + 1.0, n1])
list3 = Sequence(Segment[(0.0, Element[u_n, i + 1.0]), (Element[u_n, i + 1.0], Element[u_n, i + 1.0])], i, 1.0, If[n2 > 2.0, n1 + 1.0, n1])
list4 = Sequence(Segment[(Element[u_n, i + 1.0], Element[u_n, i + 1.0]), (Element[u_n, i + 1.0], 0.0)], i, 1.0, If[n2 > 3.0, n1 + 1.0, n1])