Author: Daniel Mentrard

C = (-0.5, 9)
K_1: (x(C), y(C) - 0.55)
d = OrthogonalLine(C, yAxis)
D = Point(d)
g = 1.6 (slider from 0 to 5, step 0.1)
K_3: (x(D), y(C) - g)
K_4: (x(K_3), y(K_3) - 4.5)
i = Segment(K_3, K_4)
E = Point(i)
j = Segment(K_3, E)
m = OrthogonalLine(K_1, yAxis)
za: round((j + 0.25) * 2.0)
A = (-0.5162501787839638, 7.4053928574435055)
r = 0.23 (slider from 0 to 1, step 0.01)
f = OrthogonalLine(D, d)
h = OrthogonalLine(K_3, f)
text5: "a = " + za
E_1: (x(K_3), y(K_3) - za / 2.0)
b = 16 (slider from 1 to 20, step 1)
list3 = Sequence(Sequence[Circle[(x(A) - 0.5 + n / 2.0, y(A) + 0.5 - m / 2.0), r], n, 1.0, b], m, 1.0, za)
c = 4 (slider from 0 to 15, step 1)
list6 = Sequence(Sequence[Segment[(x(A) - 0.5 + n / 2.0 - 0.2, y(A) + 0.5 - m / 2.0 + 0.2), (x(A) - 0.5 + n / 2.0 + 0.2, y(A) + 0.5 - m / 2.0 - 0.2)], n, 1.0, c], m, 1.0, za)
liste1 = Sequence(Sequence[Circle[(x(A) - 0.5 + n / 2.0, y(A) + 0.5 - m / 2.0), r], n, 1.0, c], m, 1.0, za)
text2: " \;  \fgcolor {0000cc}" + b + "\; - \;\fgcolor {ee0000}" + c + ""
B: (x(A) - 0.25 + b / 2.0, y(A))
F: (x(A) - 0.25, y(A))
a = Line(B, yAxis)
e = Line(F, yAxis)
k = Circle(B, 2.0 * r)
p = Circle(F, 2.0 * r)
G: (x(A) + c / 2.0 - 0.25, y(A))
l = Line(G, yAxis)
q = Circle(G, 2.0 * r)
H, I = Intersect(p, e)
J, K = Intersect(q, l)
L, M = Intersect(k, a)
N = Midpoint(I, K)
O = Midpoint(H, L)
u = Vector(O, L)
v = Vector(O, H)
w = Vector(N, K)
z = Vector(N, I)
texte3: "= " + (b - c)
liste2 = Sequence(Sequence[Circle[(x(A) - 0.5 + n / 2.0, y(A) + 0.5 - m / 2.0), r], n, c + 1.0, b], m, 4.0, 4.0)
P: (x(A) + c / 2.0 - 0.25, 5.9)
Q: (x(A) + b / 2.0 - 0.25, 5.9)
s = Circle(Q, 2.0 * r)
t = Circle(P, 2.0 * r)
R, S = Intersect(t, l)
T, U = Intersect(s, a)
V = Midpoint(S, U)
n = Vector(V, U)
u_1 = Vector(V, S)
W = (3.5057283145525924, 4.2937172160157715)
Z = (6.4977241236177194, 4.305590215258094)
A_1 = (6.5, 3.5)
B_1 = (3.5, 3.5)
poly1, w_1, z_1, a_1, b_1 = Polygon(W, Z, A_1, B_1)
texte1: "-" + c + " canicas"
texte2: "" + b + " canicas"
texte5: "Tenemos " + b + " canicas en total pero resulta
que, jugando, hemos perdido " + c + ". ¿Cuántas
nos quedan?"
texte4: "quedan: " + (b - c) + " canicas"