#3A6ED6

#DA2570

$\text{NEW QUESTION}$

$\text{SHOW VISUAL}$

$\text{SHOW NUMBER SENTENCE}$

\text{Slide to animate}

\text{\div}

#903D14

#006758

#252525

RESET

allRandomSeeds = RandomUniform(0, 0.99, 200)
countQuestion: 1
numRandoms: 2
randIndex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numRandoms)] * numRandoms) + 1
currentRandomSeeds = Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1)
questionIndex = If(countQuestion ≟ 1, 1, 1 + floor((currentRandomSeeds(1) * 6)))
holdBox: 0.3
spaceBetween: 0.2
bottomStartPt = (1.619637354504431, 13.498742514970049)
numA: 2 + floor((currentRandomSeeds(1) * 9))
numsPerRow: (floor(30 / numA) * numA)
grouped: Mod[questionIndex, 2] ≟ 1
numB: 2 + floor((currentRandomSeeds(2) * 9))
fullNumber: (numA * numB)
animateControl = 0 (slider from 0 to 2 + fullNumber, step 0.005)
animateImages = If(animateControl < 2, 0, animateControl - 2)
moveImg = If(grouped, (animateImages - (floor(animateImages / numA) * numA)) / numA, animateImages - floor(animateImages))
moveCluster = If(moveImg < holdBox, 0, (moveImg - holdBox) / (1 - holdBox))
pointIndex = If(grouped, (numA * floor(animateImages / numA)), Div[animateImages, 1])
boxIndex: (ceil((fullNumber - numA - pointIndex) / numA) * numA) + 1
StartPt = (1.5355056179774837, 17.01544910179643)
inc: 0.43
buff: (0.4 * inc)
boxHeight: (ceil(10 / 3) * inc) + buff
bottomStartPoints = Take(Flatten[Sequence[Sequence[bottomStartPt + (((3 * inc) + spaceBetween, 0) * k) - (0, (j * (boxHeight + spaceBetween - (0.2 * inc)))), k, 0, 4], j, 0, 1]], 1, numB)
oneBucket = Take(Join[{Flatten[Sequence[Sequence[((inc * Mod[k, 4]), (inc * Mod[j, 4])) + bottomStartPt, k, 0, 2], j, 0, 1]], Flatten[Sequence[Sequence[((inc * Mod[k, 4]), (inc * Mod[j, 4])) + bottomStartPt + (inc / 2, (2 * inc)), k, 0, 1], j, 0, 1]]}], 1, numA)
bottomPoints2 = Flatten(Zip[Translate[bottomStartPoints, Vector[bottomStartPt, A]], A, oneBucket])
bottomPoints1 = Flatten(Zip[Translate[oneBucket, Vector[bottomStartPt, A]], A, bottomStartPoints])
allBottomPoints = Element({bottomPoints2, bottomPoints1}, Mod[questionIndex, 2] + 1)
bottomCluster = Take(allBottomPoints, pointIndex + 1, pointIndex + numA)
allPoints = Flatten(Sequence[Sequence[((k * inc), ((-j) * inc)) + StartPt, k, 0, numsPerRow - 1], j, 0, 9])
topCluster = Take(allPoints, boxIndex, boxIndex + numA - 1)
numMoving = If(grouped, numA, 1)
moving: animateImages ≠ pointIndex
n2Index: {3.1, 6.5, 6.7, 7, 7.2, 6.4}
n1Index: {8.2, 1.67, 4.13, 4.13, 3.6, 3.7}
questionNum = If(Mod[questionIndex, 2] ≟ 1, numA, numB)
numSpace = If(questionNum < 10, "\phantom{0}", "")
textQ4: "\textsf{A toymaker has }\textcolor{" + (LaTeX[colorPink]) + "}\textbf{" + (LaTeX[fullNumber]) + "}\textsf{ bee plushies and }\textcolor{" + (LaTeX[colorBlue]) + "}\textbf{" + (LaTeX[numB]) + "}\textsf{ toy hives. How many bees can he place in each hive?}"
textQ2: "\textcolor{" + (LaTeX[colorPink]) + "}\textbf{" + (LaTeX[fullNumber]) + "}\textsf{ marbles are divided equally into }\textcolor{" + (LaTeX[colorBlue]) + "}\textbf{" + (LaTeX[numB]) + "}\textsf{ jars.}\textsf{ How many marbles are in each jar?}"
textQ5: "\textsf{A farmer has }\textcolor{" + (LaTeX[colorPink]) + "}\textbf{" + (LaTeX[fullNumber]) + "}\textsf{ apples. He wants to put }\textcolor{" + (LaTeX[colorBlue]) + "}\textbf{" + (LaTeX[numA]) + "}\textsf{ apples in each bag.}\textsf{ How many bags can he make?}"
fullSpace = If(fullNumber < 10, "\phantom{00}", If[fullNumber < 100, "\phantom{0}", ""])
textQ3: "\textsf{A toymaker has }\textcolor{" + (LaTeX[colorPink]) + "}\textbf{" + (LaTeX[fullNumber]) + "}\textsf{ bee plushies, and places }\textcolor{" + (LaTeX[colorBlue]) + "}\textbf{" + (LaTeX[numA]) + "}\textsf{ in each hive. How many hives are needed?}"
textQ1: "\textsf{Each jar can hold }\textcolor{" + (LaTeX[colorBlue]) + "}{\textbf{" + (LaTeX[numA]) + "}}\textsf{ marbles. A teacher has }\textcolor{" + (LaTeX[colorPink]) + "}{\textbf{" + (LaTeX[fullNumber]) + "}}\textsf{ marbles. How many jars can she fill
?}"
textQ6: "\textsf{A farmer puts }\textcolor{" + (LaTeX[colorPink]) + "}\textbf{" + (LaTeX[fullNumber]) + "}\textsf{ apples equally in }\textcolor{" + (LaTeX[colorBlue]) + "}\textbf{" + (LaTeX[numB]) + "}\textsf{ bags.}\textsf{ How many apples are there in each bag?}"
division = false
divIndex = 0 (slider from 0 to (numA * numB), step 1)
MultGroups = Flatten(Sequence[Sequence[(k, (j * 0.2)), k, 1, numA], j, 1, numB])
division2 = true
multiplication = false
multIndex = 0 (slider from 0 to numA, step 1)
multPoints = Take(oneBucket, 1, (multIndex * numB))
hopFunc(x) = ((-1 / 5 * (x - (numB * floor(x / numB)))) * (x - (numB * (floor(x / numB) + 1))))
showVisual: true
showEquation: true
appletSize = Corner(5)
topPoints = If(moving, Take[allPoints, 1, fullNumber - pointIndex - numMoving], Take[allPoints, 1, fullNumber - pointIndex])
bottomPoints = Take(allBottomPoints, 1, pointIndex)
boxWidth: (3 * inc) + (1 * buff)
bagIndex = If(¬grouped, numB, ceil(pointIndex / numA))
boxes = Take(Zip[makeBox[A + ((-0.2 * inc), boxHeight - (0.2 * inc)), boxWidth, boxHeight], A, bottomStartPoints], 1, bagIndex)
num1End = (1.5523319652828735, 17.957724550898234)
num2End: (2.47778, 17.96)
numText1: "\text{" + (LaTeX[fullNumber]) + "}"
numText2: "" + (LaTeX[If[questionIndex ≟ 2, (("\text{" * numB) * "}"), (("\text{" * numA) * "}")]]) + ""
animateNumbers = 1 (slider from 0 to 1, step 0.01)
questionText: "\text{" + (LaTeX[Element[{textQ1, textQ2, textQ3, textQ4, textQ5, textQ6}, questionIndex]]) + "}"
boxY: 18.7
N1Start: (Element[n1Index, questionIndex], 18.5)
N1Vec = Vector(N1Start, num1End)
N2Start: (Element[n2Index, questionIndex], 18.5)
N2Vec = Vector(N2Start, num2End)
movingN1Text: "\text{" + (LaTeX[fullNumber]) + "}"
movingN2Text: "\text{" + (LaTeX[questionNum]) + "}"
answer = If(questionIndex ≟ 2, numA, numB)
speed: 8
divLocation = (12.540599250936335, 16.931317365269464)
visualSpeed: 8
imgStart = Element(allPoints, fullNumber - pointIndex)
imgEnd = Element(allBottomPoints, pointIndex + 1)
imageVec = Vector(imgStart, imgEnd)
answerText1: "\textsf{She can fill " + (LaTeX[numB]) + " jars of marbles.}"
answerText3: "\textsf{ " + (LaTeX[numB]) + "} \textsf{ toy hives are needed.}"
answerText2: "\textsf{There are " + (LaTeX[numA]) + " marbles in each jar.}"
Q2 = NaN
a(t, x) = ((((t * ℯ) * x) * t) * Q2)
animateInitial = If(animateControl ≤ 2, animateControl, 2)
showImages: 0.2
answerNum = If(Mod[questionIndex, 2] ≟ 1, numB, numA)
boxLocation: Element[allPoints, boxIndex] - ((0.1 * inc), (0.1 * inc))
currentBox = makeBox(boxLocation + (0.01, 0.05), (inc * numA), (-inc))
equationText: "" + (LaTeX[If[animateControl ≟ fullNumber + 2, (((((((((("\textcolor{" * colorPink) * "}\textbf{") * fullNumber) * "}\div\textcolor{") * colorBlue) * "}\textbf{") * questionNum) * "}=") * answerNum) * ""), If[animateInitial < 1, "", If[1 ≤ animateInitial < 2, (((("\textcolor{" * colorPink) * "}\textbf{") * fullNumber) * "}"), (((((((("\textcolor{" * colorPink) * "}\textbf{") * fullNumber) * "}\div\textcolor{") * colorBlue) * "}\textbf{") * questionNum) * "}=")]]]]) + ""
currentPic = If(questionIndex ≟ 1 ∨ questionIndex ≟ 2, picMarble, If[questionIndex ≟ 3 ∨ questionIndex ≟ 4, picBee, picApple])
imagesCurrent = Zip(Translate[currentPic, Vector[StartPt, k]], k, Join[{topPoints, bottomPoints}])
answerText4: "\textsf{He can place }" + (LaTeX[numA]) + "\textsf{ bee plushies in each toy hive.}"
answerText5: "\textsf{He can make }" + (LaTeX[numB]) + "\textsf{ bags of apples.}"
answerText6: "\textsf{There are }" + (LaTeX[numA]) + "\textsf{ apples in each bag.}"
answerText: "" + (LaTeX[Element[{answerText1, answerText2, answerText3, answerText4, answerText5, answerText6}, questionIndex]]) + ""
picCluster = Zip(Translate[currentPic, Vector[StartPt, K]], K, topCluster)
clusterVectors = Zip(Vector[(Vector[K, J] * moveCluster)], K, topCluster, J, bottomCluster)
movingClusterImages = Zip(Translate[A, Vector[B]], A, picCluster, Vector[B], clusterVectors)
currentContainer = If(questionIndex ≟ 1 ∨ questionIndex ≟ 2, picJar, If[questionIndex ≟ 3 ∨ questionIndex ≟ 4, picHive, picBag])
imagesJar = Take(Zip[Translate[currentContainer, Vector[StartPt, k]], k, bottomStartPoints], 1, bagIndex)
boxColor = Element({colorTeal, colorTeal, colorBlack, colorBlack, colorBrown, colorBrown}, questionIndex)

Tool: centerBox
(width,height,CenterPoint)
Input: width, length, StartPoint
Output: myBox

StartPoint: (0, 0)
A: StartPoint + (((-width)) / 2, ((-length)) / 2)
D: A + (0, length)
B: A + (width, 0)
C: A + (width, length)
myBox = Polygon({A, B, C, D})

Tool: makeBox
makeBox(point, width,height)
Input: PointText1, boxWidth, boxHeight
Output: BoxText1

PointText2: PointText1 + (boxWidth, 0)
PointText3: PointText2 - (0, boxHeight)
PointText4: PointText1 - (0, boxHeight)
BoxText1 = Polygon({PointText1, PointText2, PointText3, PointText4})