Número de discos:

Inicio

A

B

C

Game over

d: {{1, 2, 3, 4, 5, 100}, {100}, {100}}
discos: {"1 .", "2 .", "3 .", "4 .", "5 .", "6 .", "7 .", "8 .", "9 .", "10 ."}
n = SelectedIndex(discos)
mov = 0
animar = 0.74 (slider from 0 to 1, step 0.01)
total: 2^(n) - 1
r: 0.25
sep: 1
vector: {(-6, 2), (-6, 1.5), (-6, 1), (-6, 0.5), (-6, 0), (-6, -0.5), (-6, -1), (-6, -1.5), (-6, -2), (-6, -2.5)}
a: (20 * r) + sep
textoMovimiento: "Movimiento número " + mov + ""
velocidad = 2 (slider from 1 to 10, step 1)
auxiliar = 3.98 (slider from -5 to 5)
suelo = Segment(((-10 * r) - sep - 6, 0), ((10 * r) + sep + 6, 0))
restos = Sequence(Mod[mov + 2^(k - 1) + 1, 2^(k)], k, 1, 10)
discoSig = IndexOf(0, restos)
bin = ToBase(mov + 1, 2)
textobinario: "Próximo movimiento (en binario):  " + bin + ""
bin2 = Sum(Sequence[Take[bin, k, k], k, Length[bin], 1, -1])
pos: ((Length[bin] - IndexOf["1", bin2]) * 0.14)
texto1: "↑
Disco " + discoSig + ""
h: 0.5
pol = Sequence(Polygon[(((-k) * r), 0), ((k * r), 0), ((k * r), h), (((-k) * r), h)], k, 1, 10)
A1 = Translate(pol(1), vector(1))
A2 = Translate(pol(2), vector(2))
A3 = Translate(pol(3), vector(3))
A4 = Translate(pol(4), vector(4))
A5 = Translate(pol(5), vector(5))
A6 = Translate(pol(6), vector(6))
A7 = Translate(pol(7), vector(7))
A8 = Translate(pol(8), vector(8))
A9 = Translate(pol(9), vector(9))
A10 = Translate(pol(10), vector(10))
barras: {Segment[((-a), 0.06), ((-a), (10 * h) + r)], Segment[(0, 0.06), (0, (10 * h) + r)], Segment[(a, 0.06), (a, (10 * h) + r)]}
pos1 = If(discoSig ≟ d(1, 1), 1, If[discoSig ≟ d(2, 1), 2, 3])
par = Mod(n + mov, 2)
pos2 = If(discoSig ≟ 1 ∧ pos1 + par ≟ 2, 3, If[discoSig ≟ 1 ∧ pos1 + par ≟ 3, 1, If[discoSig ≟ 1, 2, If[d(1, 1) ≟ 1 ∧ d(2, 1) < d(3, 1), 3, If[d(1, 1) ≟ 1 ∧ d(3, 1) < d(2, 1), 2, If[d(2, 1) ≟ 1 ∧ d(1, 1) < d(3, 1), 3, If[d(2, 1) ≟ 1 ∧ d(3, 1) < d(1, 1), 1, If[d(3, 1) ≟ 1 ∧ d(1, 1) < d(2, 1), 2, 1]]]]]]])
d1 = Join({First[d, pos2 - 1], {Join[{{d(pos1, 1)}, d(pos2)}]}, Last[d, 3 - pos2]})