Grid Variations

This is causing me all kinds of problems with the GeoGebra, but I still liked the visual effect.

Directly inspired by some recent sasj work, like this one https://sasj.tumblr.com/post/186871787585/geometric-shapes-190808

GeoGebra forum talking about my problems: https://help.geogebra.org/topic/understanding-random-behavior

new

more

n = 15 (slider from 4 to 20, step 1)
j = CurveCartesian(cos(t), sin(t) + 1, t, (3 * π / 2), (2 * π))
i = CurveCartesian(cos(t) + 1, sin(t), t, π / 2, π)
h = CurveCartesian(cos(t) + 1, sin(t) + 1, t, π, (3 * π / 2))
g = CurveCartesian(cos(t) + 1, sin(t) + 1, t, π, (3 * π / 2))
f = CurveCartesian(cos(t), sin(t), t, 0, π / 2)
e = CurveCartesian(t, 0, t, 0, 1)
d = CurveCartesian(0, t, t, 0, 1)
c = CurveCartesian(t, 1, t, 0, 1)
b = CurveCartesian(1, t, t, 0, 1)
g1 = Segment((0, 0), (0, 1))
g2 = Segment((1, 1), (0, 1))
g3 = Segment((1, 1), (1, 0))
f1 = CircleArc((0, 0), (1, 0), (0, 1))
g4 = Segment((0, 0), (1, 0))
f2 = CircleArc((0, 1), (0, 0), (1, 1))
f3 = CircleArc((1, 1), (0, 1), (1, 0))
f4 = CircleArc((1, 0), (1, 1), (0, 0))
aspect: x(Corner[5]) / y(Corner[5])
l3: {{f1, f2, f3, f4}, {g1, g2, g3, g4}}
l6: {b, c, d, e, f, g, h, i, j}
a = true
l4 = Sequence(Sequence[Translate[RandomElement[l6], ((2 * i), j)], i, Max[1, j - 3], n / 2], j, 1, n)
l1 = Sequence(Sequence[Translate[RandomElement[l6], (i, j)], i, 1, n, 2], j, 2, n)
l2 = Sequence(Sequence[Translate[RandomElement[l6], (i, j)], i, 1, n, 3], j, 1, n)
l5 = Sequence(Sequence[Translate[RandomElement[l6], (i, j)], i, 1, Min[n, j + 3]], j, 3, n)