1: standard → expanded. 2: expanded → standard

\text{Drag into the blank}

#4D4D4D

$\text{NEW NUMBER}$

Fix position and allow selection for all text objects

Empty all input boxes

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#6557D2

#8575FF

#903D14

#BD6C43

#C75000

#E07415

#eeeeee

#2E006758

#2EB00020

$\textsf{ANIMATE}$

\textsf{Place each digit into the Expansion Machine.} 

reset

numRandoms = 6
countQuestion = 0
allRandomSeeds = Sequence(Random[1, 99] / 100, A, 1, 200)
randIndex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numRandoms)] * numRandoms) + 1
currentRandomSeeds = Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1)
digit1 = If(countQuestion ≟ 0, 2, floor((currentRandomSeeds(1) * 10)))
spaceIn = If(digit1 ≟ 0, 2, 3)
wid: 0.2
IniPoint: (x(Corner[1]) + (x(Corner[2]) - x(Corner[1]) - (If[digit1 ≟ 0, 5, 6] * wid)) / 2, 1.4)
C5 = (2.998283355063021, 1.4)
hei: 0.25
q5 = DraggableRectangle(C5, wid, hei)
Cor3 = (5.137874837027389, 2.0063272727272743)
Cor1 = (0.32535853976532053, -1.0147999999999984)
MoveMachine = (1.3496176562500017, -0.46027679999999976)
anim = 0 (slider from 0 to endAnim, step 0.1)
randomNum2: (currentRandomSeeds(2) * 1000000) + (currentRandomSeeds(3) * 10000) + (currentRandomSeeds(4) * 100)
randomNumCase = If(currentRandomSeeds(1) ≤ 0.5, 1, 2)
input2: NaN
input1: NaN
onboarding = true
B = (5.000341064524864, 5.69392166828734)
tries = 0
showbuttons = true
typicalError1: 0
typicalError2: 0
pixelsRight: 16
pixelsLeft: 16
pixelsBottom: 16
pixelsTop: 24
layoutY: 178 - 24 - (92 - 64)
layoutX: 16
layoutAppSize = Corner(5)
pulsingSpeed: 8
pulsing = 0.9 (slider from 0 to 1, step 0.1)
haloPixels: (pulsing * 7)
onboardingDisplayText: "" + (LaTeX[onboardingText]) + ""
A = (4.591072725036432, 5.892161020227049)
C = (4.917208433066277, 6.084005554362252)
layoutOnboarding = PointToPixels(Corner[onboardingDisplayText, 2], Corner[1], Corner[3], Corner[5])
onboardingX: ((x(Midpoint[Vertex[q5, 1], Vertex[q5, 2]]) - x(Cor1)) * 800 / x(Cor3 - Cor1)) - 12
onboardingY: 130
onboardingCase = 3
OnboardingTextOffset = onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5])
eq1: x = x(Corner[1]) + (x(Corner[2] - Corner[1]) / 800 * 16)
MoveGL = (0.9570013037809668, -0.410574545454544)
hGL: y = y(MoveGL)
procesing = 0
animPrev = 0 (slider from 0 to 1)
speed: 2
animPos = 0 (slider from 0 to 1)
AnimPoint: (If[animPrev < 1, 0.96 + animPrev, 0.96 + 1 + (1.75 * animPos)], 0.05)
D: MoveMachine + ((0.02 * sin(((7 * pi) * anim))), (-0.02 * sin(((9 * pi) * anim))))
imgSize: 1.6
E: MoveMachine + (imgSize, 0) - ((0.02 * sin(((5 * pi) * anim))), (-0.02 * sin(((9 * pi) * anim))))
F: MoveMachine + (imgSize, imgSize) + ((0.02 * sin(((7 * pi) * anim))), (-0.02 * sin(((7 * pi) * anim))))
G: MoveMachine + (0, imgSize) - ((0.02 * sin(((8 * pi) * anim))), (-0.02 * sin(((7 * pi) * anim))))
MoveBand = (0.875247812500001, -0.4473452799999998)
J: MoveBand + (3, 0)
btnLabel: If[animPrev ≟ 0, "$\textsf{ANIMATE}$", "$\textsf{REPLAY}$"] + ""
digit2 = Element(Sequence[0, 9] \ {digit1}, floor((currentRandomSeeds(2) * 8)) + 1)
digit3 = Element(Sequence[0, 9] \ {digit1, digit2}, floor((currentRandomSeeds(3) * 7)) + 1)
digit4 = Element(Sequence[0, 9] \ {digit1, digit2, digit3}, floor((currentRandomSeeds(4) * 6)) + 1)
digit5 = Element(Sequence[0, 9] \ {digit1, digit2, digit3, digit4}, floor((currentRandomSeeds(5) * 5)) + 1)
digit6 = Element(Sequence[0, 9] \ {digit1, digit2, digit3, digit4, digit5}, floor((currentRandomSeeds(6) * 5)) + 1)
C1 = (2.1316166883963543, 1.4)
q1, c1, f, g, h = Polygon(C1, C1 + (wid, 0), C1 + (wid, hei), C1 + (0, hei))
C2 = (2.3316166883963545, 1.4)
q2 = DraggableRectangle(C2, wid, hei)
C3 = (2.5316166883963542, 1.4)
C4 = (2.7982833550630213, 1.4)
C6 = (3.1982833550630207, 1.4)
q3 = DraggableRectangle(C3, wid, hei)
q4 = DraggableRectangle(C4, wid, hei)
q6 = DraggableRectangle(C6, wid, hei)
Home = Sequence(Translate[IniPoint, ((wid * ii), 0) + (If[ii ≥ spaceIn, wid / 3, 0], 0)], ii, If[digit1 ≟ 0, -1, 0], If[digit1 ≟ 0, 4, 5])
vec: (wid / 2, hei / 2)
TargetCorner: (0.96, 0.05)
q7 = DraggableRectangle(AnimPoint, wid, hei)
boxesInMov = Zip(¬(PP ∈ Home ∨ PP ≟ TargetCorner), PP, Take[{C1, C2, C3, C4, C5, C6}, If[digit1 ≟ 0, 2, 1]])
boxesInTarget = Zip(IntersectPath[qq, q7], qq, {q1, q2, q3, q4, q5, q6})
digits: {digit1, digit2, digit3, digit4, digit5, digit6}
numbers = Zip((dd * 10^(6 - kk)), dd, digits, kk, Sequence[6])
lengthAnim = Zip(Max[If[dd ≟ 0, 1, kk], 1], dd, digits, kk, Reverse[Sequence[0, 5]])
endAnim = If(procesing ≟ 0, 1, lengthAnim(procesing))
processed: {}
textsForTable = If(Length[processed] ≟ 0, {"k"}, Zip[AddCommas[Text[Element[numbers, kk]]], kk, Sort[processed]])
H: (3.45, -0.01)
l1: Take[{C1, C2, C3, C4, C5, C6}, If[digit1 ≠ 0, 1, 2]] \ {IniPoint}
l2 = If(Length[textsForTable] ≥ 2, Append[textsForTable(1), Zip[(" + " * tt), tt, Take[textsForTable, 2]]], {})
shownew = false
hGL' = Translate(hGL, Vector[(Vector[Corner[4], Corner[1]] / 500 * 16)])
eq2: x = x(MoveGL)
allProcessed: Length[RemoveUndefined[Take[boxesInTarget, If[digit1 ≟ 0, 2, 1]]]] ≟ If[digit1 ≟ 0, 5, 6]
text3: "\textsf{" + (LaTeX[AddCommas[Text[Sum[numbers]]]]) + " = " + (LaTeX[Sum[l2]]) + "}"
procesingTile = Text((("\textsf{" * AddCommas[Text[(Element[digits, procesing] * 10^(Min[floor(anim), 6 - procesing]))]]) * "}"), AnimPoint + vec, true, true, 0, 0)
text1 = If(Length[textsForTable] ≥ 1, TableText[Zip[(("\textsf{" * tt) * "}"), tt, textsForTable], "vr"], "")
text2 = Text(text1, (3.75, 0), true, true, 1, 1)
pulsingObject = expandQuad(Vertex[q5, 1], Vertex[q5, 2], Vertex[q5, 3], Vertex[q5, 4], (7 * pulsing), Corner[1], Corner[3], Corner[5])
tile1F = Text(digit1, Home(-6) + vec, true, true, 0, 0)
tile1M = Text(digit1, C1 + vec, true, true, 0, 0)
tile2F = Text(digit2, Home(-5) + vec, true, true, 0, 0)
tile2M = Text(digit2, C2 + vec, true, true, 0, 0)
tile3F = Text(digit3, Home(-4) + vec, true, true, 0, 0)
tile3M = Text(digit3, C3 + vec, true, true, 0, 0)
tile4F = Text(digit4, Home(-3) + vec, true, true, 0, 0)
tile4M = Text(digit4, C4 + vec, true, true, 0, 0)
tile5F = Text(digit5, Home(-2) + vec, true, true, 0, 0)
tile5M = Text(digit5, C5 + vec, true, true, 0, 0)
tile6F = Text(digit6, Home(-1) + vec, true, true, 0, 0)
tile6M = Text(digit6, C6 + vec, true, true, 0, 0)
text4 = Text(",", Midpoint[Home(4), Home(3)] + (0.03, 0.07), true, true, 1, 0)
activeDropDown = Element(Take[boxesInTarget, If[digit1 ≟ 0, 2, 1]], IndexOf[true, boxesInMov])
I: H + ((2.5 * wid), 0)
q1B: q1
q4B: q4
q5B: q5
q6B: q6
q3B: q3
q2B: q2
layerPol = Zip((((("SetLayer(q" * nn) * ",") * If[tt, 8, 1]) * ")"), tt, boxesInMov, nn, Sequence[If[digit1 ≟ 0, 2, 1], 6])
layerText = Zip((((("SetLayer(tile" * nn) * "M,") * If[tt, 9, 2]) * ")"), tt, boxesInMov, nn, Sequence[If[digit1 ≟ 0, 2, 1], 6])
layerBorders = Zip((((("SetLayer(q" * nn) * "B,") * If[tt, 9, 2]) * ")"), tt, boxesInMov, nn, Sequence[If[digit1 ≟ 0, 2, 1], 6])

Tool: PointToPixels
PointToPixels(InputPoint,Corner1,Corner3,Corner5)
Input: InputPoint, Corner1, Corner3, Corner5
Output: OutputPixels

xLeft: x(Corner1)
xRight: x(Corner3)
yTop: y(Corner3)
yBottom: y(Corner1)
yPixels: (y(Corner5) * (yTop - y(InputPoint)) / (yTop - yBottom))
xPixels: (x(Corner5) * (x(InputPoint) - xLeft) / (xRight - xLeft))
OutputPixels: (xPixels, yPixels)

Tool: sectorPixels
sectorPixels(Midpoint,B,C,pixelRadius,Corner1,Corner3,Corner5
Input: A, B, C, pixelRadius, Corner1, Corner3, Corner5
Output: newSector

pointRadius: (pixelRadius / x(Corner5) * (x(Corner3) - x(Corner1)))
BPrime: A + (pointRadius * UnitVector[B - A])
newSector = CircleSector(A, BPrime, C)

Tool: onboardingTextOffset
onboardingTextOffset(textCorner1,textCorner3,case,corner1,corner3,corner5)
Input: CornerText1, CornerText3, case, Corner1, Corner3, Corner5
Output: TextOffset

xPixels: ((x(CornerText3) - x(CornerText1)) * x(Corner5) / (x(Corner3) - x(Corner1)))
yPixels: ((y(CornerText3) - y(CornerText1)) * y(Corner5) / (y(Corner3) - y(Corner1)))
xOffset = Element({27, (-xPixels) + 2, 16 - xPixels / 2, 16 - xPixels / 2}, case)
yOffset = Element({-23, -23, yPixels - 27, -49}, case)
TextOffset: (xOffset, yOffset)

Tool: AddSpace
Input: textGivenNum
Output: textGivenNumWithSpace

textGivenNumWithSpace: "" + (LaTeX[Take[textGivenNum, 1, Length[textGivenNum] - 3]]) + "\," + (LaTeX[Take[textGivenNum, Length[textGivenNum] - 2]]) + ""

Tool: AddCommas
select a text
Input: text1
Output: text2

15224509

l1 = TextToUnicode(text1)
l2 = Reverse(l1)
l4 = If(Mod[Length[l2], 3] ≠ 0, Take[l2, (floor(Length[l2] / 3) * 3) + 1], {})
m1 = Sequence(Take[l2, (3 * ii) + 1, (3 * ii) + 3], ii, 0, floor(Length[l2] / 3) - 1)
l3 = Flatten({Zip[{ll, {44}}, ll, m1], l4})
l5 = If(Element[l3, Length[l3]] ≟ 44, Take[l3, 1, Length[l3] - 1], l3)
text2 = UnicodeToText(Reverse[l5])

Tool: DraggableRectangle
corner1 width and height
Input: C1, wid, hei
Output: q1

wid: 0.4
hei: 0.4
q1, c1, f, g, h = Polygon(C1, C1 + (wid, 0), C1 + (wid, hei), C1 + (0, hei))

Tool: expandQuad
expandQuad(A,B,C,D,pixelGap,Corner1,Corner3,Corner5)
Input: A, B, C, D, pixelGap, Corner1, Corner3, Corner5
Output: newPolygon

Corner5: (800, 500)
Corner3: (7, 6)
Corner1: (-4, -2)
distanceY: (pixelGap / y(Corner5) * (y(Corner3) - y(Corner1)))
distanceX: (pixelGap / x(Corner5) * (x(Corner3) - x(Corner1)))
pointGap: distanceX
allVerts: {A, B, C, D}
concaveAngles = Zip(Angle[I, J, K] > 180°, I, Append[allVerts(-1), allVerts], J, allVerts, K, Append[Take[allVerts, 2], allVerts(1)])
allVecs = Zip(Vector[J, K], J, allVerts, K, Append[Take[allVerts, 2], allVerts(1)])
pVecs = Zip(Vector[UnitOrthogonalVector[A]], Vector[A], allVecs)
xyScale: (distanceY) / (distanceX)
circTemplate = CurveCartesian((pointGap * cos(t)), ((xyScale * pointGap) * sin(t)), t, 0, (2 * pi))
scaledVecs = Zip(Vector[(x(K), (xyScale * y(K)))], Vector[K], pVecs)
vPointsPre = Zip(A - (pointGap * B), A, allVerts, B, Append[scaledVecs(-1), scaledVecs])
vPointsPost = Zip(A - (pointGap * B), A, allVerts, Vector[B], scaledVecs)
endAngles = Zip(Angle[M + (1, 0), M, K], K, vPointsPost, M, allVerts)
startAngles = Zip(Angle[M + (1, 0), M, K], K, vPointsPre, J, vPointsPost, M, allVerts)
roundedCornersConvex = Zip(Sequence[circTemplate(K) + A, K, B, C + If[B > C, (2 * pi), 0], (C + If[B > C, (2 * pi), 0] - B) / 4], A, allVerts, B, endAngles, C, startAngles)
roundedCornersConcave = Zip(Sequence[circTemplate(K) + A, K, B, C + If[B > C, (2 * pi), 0], (C + If[B > C, (2 * pi), 0] - B) / 4], A, allVerts, B, startAngles, C, endAngles)
cornerAngles = Zip(Angle[A, B, C], A, vPointsPre, B, allVerts, C, vPointsPost)
cornerPoints = Flatten(Zip[If[¬Concave, {Element[D, 3]}, If[A < pi / 3 ∨ (¬Concave), {Element[C, 3]}, C]], A, cornerAngles, C, roundedCornersConcave, D, roundedCornersConvex, Concave, concaveAngles])
newPolygon = Polygon(cornerPoints)