1J

1K

C1

Q_0

\overline Q

Q_1

Q_2

Q_3

1J

1J

1J

C1

C1

C1

1K

1K

1K

Start

gatx = (1, 0)
gaty = (0, -2)
A = (2.5, 5)
a = Segment(A, A + gatx)
b = Segment(A, A + gaty)
c = Segment(A + gatx, A + gatx + gaty)
d = Segment(A + gaty, A + gatx + gaty)
f = Segment(A - (0.5 * gatx) + (0.5 * gaty), A + (0.5 * gaty))
k_3 = Segment(A - (0.5 * gatx) + (0.85 * gaty), A + (0.85 * gaty))
e = Segment(A - (0.5 * gatx) + (0.15 * gaty), A + (0.15 * gaty))
h = Segment(A + gatx + (0.25 * gaty), A + (0.25 * gaty) + (1.5 * gatx))
i = Segment(A + (1.2 * gatx) + (0.75 * gaty), A + (0.75 * gaty) + (1.5 * gatx))
k_1 = Circle(A + (1.1 * gatx) + (0.75 * gaty), 0.1)
j_1 = Segment(A + (0.45 * gaty), A + (0.5 * gaty) + (0.3 * gatx))
l = Segment(A + (0.55 * gaty), A + (0.5 * gaty) + (0.3 * gatx))
clock = 0 (slider from 0 to 128, step 1)
g = Segment((1, 4), (2, 4))
k = Segment((2, 5.5), (2, 3.3))
t = 3.4 (slider from 0 to 10, step 0.1)
jkq1: Mod[clock, 4] > 1
njkq1: ¬jkq1
D = Intersect(e, k)
E = Intersect(k_3, k)
F = Intersect(e, k)
B = (5, 5)
C = (7.5, 5)
G = (10, 5)
p, m, n, q, r, s, a_1, b_1, c_1, d_1, e_1, f_1 = jk(B, gatx, gaty)
g_1, h_1, i_1, l_1, m_1, n_1, p_1, q_1, r_1, s_1, t_1, a_2 = jk(C, gatx, gaty)
c_2, b_2, d_2, e_2, f_2, g_2, h_2, i_2, j_2, k_2, l_2, m_2 = jk(G, gatx, gaty)
n_2 = Segment((4.5, 5.5), (4.5, 3.3))
p_2 = Segment((7, 5.5), (7, 3.3))
q_2 = Segment((9.5, 5.5), (9.5, 3.3))
j = Segment((1, 5.5), (9.5, 5.5))
H = Intersect(j, n_2)
I = Intersect(j, p_2)
J = Intersect(n_2, s)
K = Intersect(n_2, b_1)
L = Intersect(p_2, n_1)
M = Intersect(p_2, q_1)
N = Intersect(q_2, g_2)
O = Intersect(q_2, i_2)
s_2 = Segment((6.5, 4.5), (6.5, 4))
t_2 = Segment((9, 4.5), (9, 4))
a_3 = Segment((4, 4), (4.5, 4))
b_3 = Segment((6.5, 4), (7, 4))
c_3 = Segment((9, 4), (9.5, 4))
jkq2: Mod[clock, 8] > 3
njkq2: ¬jkq2
jkq3: Mod[clock, 16] > 7
njkq3: ¬jkq3
jkq4: Mod[clock, 32] > 15
njkq4: ¬jkq4
P = (11.25, 7.5)
Vieleck1, p_3, d_3, e_3, f_3 = Polygon(P, P + (0.5 * gatx), P + (0.5 * gatx) + (0.5 * gaty), P + (0.5 * gaty))
Q = (12.25, 7.5)
R = (13.25, 7.5)
S = (14.25, 7.5)
Vieleck2, g_3, h_3, i_3, j_3 = LED(gatx, gaty, Q)
Vieleck3, l_3, m_3, n_3, q_3 = LED(gatx, gaty, R)
Vieleck4, r_3, s_3, t_3, a_4 = LED(gatx, gaty, S)
b_4 = Segment((11.5, 4.5), (11.5, 6.5))
c_4 = Segment((9, 4.5), (9, 5.75))
d_4 = Segment((9, 5.75), (12.5, 5.75))
e_4 = Segment((12.5, 5.75), (12.5, 6.5))
f_4 = Segment((6.5, 4.5), (6.5, 6))
g_4 = Segment((6.5, 6), (13.5, 6))
h_4 = Segment((13.5, 6), (13.5, 6.5))
i_4 = Segment((4, 6.25), (14.5, 6.25))
j_4 = Segment((14.5, 6.25), (14.5, 6.5))
T = Intersect(f_4, c_1)
U = Intersect(c_4, r_1)
r_2 = Segment((4, 4), (4, 6.25))
V = Intersect(r_2, h)
Vieleck5, k_4, l_4, m_4, n_4 = Polygon((0.5, 3.5), (1, 3.5), (1, 4.5), (0.5, 4.5))
ce: Mod[clock, 2] > 0

Tool: UND
Input: gatx, gaty, E
Output: l_1, m_1, p_1, n_1, q_1, r_1, s_1

l_1 = Segment(E, E + gatx)
m_1 = Segment(E, E + gaty)
n_1 = Segment(E + gatx, E + gatx + gaty)
p_1 = Segment(E + gaty, E + gatx + gaty)
q_1 = Segment(E - (0.5 * gatx) + (0.25 * gaty), E + (0.25 * gaty))
r_1 = Segment(E - (0.5 * gatx) + (0.75 * gaty), E + (0.75 * gaty))
s_1 = Segment(E + gatx + (0.5 * gaty), E + (1.5 * gatx) + (0.5 * gaty))

Tool: jk
Input: A, gatx, gaty
Output: k, a, b, c, d, e, f, g, h, i, j, l

a = Segment(A, A + gatx)
b = Segment(A, A + gaty)
c = Segment(A + gatx, A + gatx + gaty)
d = Segment(A + gaty, A + gatx + gaty)
f = Segment(A - (0.5 * gatx) + (0.5 * gaty), A + (0.5 * gaty))
g = Segment(A - (0.5 * gatx) + (0.85 * gaty), A + (0.85 * gaty))
e = Segment(A - (0.5 * gatx) + (0.15 * gaty), A + (0.15 * gaty))
h = Segment(A + gatx + (0.25 * gaty), A + (0.25 * gaty) + (1.5 * gatx))
i = Segment(A + (1.2 * gatx) + (0.75 * gaty), A + (0.75 * gaty) + (1.5 * gatx))
k = Circle(A + (1.1 * gatx) + (0.75 * gaty), 0.1)
j = Segment(A + (0.45 * gaty), A + (0.5 * gaty) + (0.3 * gatx))
l = Segment(A + (0.55 * gaty), A + (0.5 * gaty) + (0.3 * gatx))

Tool: jk (command jk1)
Input: A, gatx, gaty
Output: k, a, b, c, d, e, f, g, h, i, j, l

a = Segment(A, A + gatx)
b = Segment(A, A + gaty)
c = Segment(A + gatx, A + gatx + gaty)
d = Segment(A + gaty, A + gatx + gaty)
f = Segment(A - (0.5 * gatx) + (0.5 * gaty), A + (0.5 * gaty))
g = Segment(A - (0.5 * gatx) + (0.85 * gaty), A + (0.85 * gaty))
e = Segment(A - (0.5 * gatx) + (0.15 * gaty), A + (0.15 * gaty))
h = Segment(A + gatx + (0.25 * gaty), A + (0.25 * gaty) + (1.5 * gatx))
i = Segment(A + (1.2 * gatx) + (0.75 * gaty), A + (0.75 * gaty) + (1.5 * gatx))
k = Circle(A + (1.1 * gatx) + (0.75 * gaty), 0.1)
j = Segment(A + (0.45 * gaty), A + (0.5 * gaty) + (0.3 * gatx))
l = Segment(A + (0.55 * gaty), A + (0.5 * gaty) + (0.3 * gatx))

Tool: LED
Input: gatx, gaty, P
Output: Vieleck1, f_3, e_3, p_3, d_3

Vieleck1_1, p_1, d_1, e_1, f_1 = Polygon(P, P + (0.5 * gatx), P + (0.5 * gatx) + (0.5 * gaty), P + (0.5 * gaty))
Vieleck1, p_3, d_3, e_3, f_3 = Polygon(P, P + (0.5 * gatx), P + (0.5 * gatx) + (0.5 * gaty), P + (0.5 * gaty))