#c0c0c0

#E17415

#8575FF

\text{Question text}

set in onClick scripts of quilt pieces to the index of the outline highlight for that piece.

$\textsf{START OVER}$

\text{Make a quilt in 3 colors! \textbf{Tap each patch} to find the area of 
fabric needed for each\color.}

\text{Area of Each Color (square units)}

$\textsf{\(1\) sq unit}$

$\textsf{\(0.5\) sq. units}$

data3: {}
data2: {}
data1: {}
maxRows = Max({Length[data1], Length[data2], Length[data3]})
numZeros = Max(0, maxRows - 1)
zeroStr = Element({"", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000"}, numZeros + 1)
col0 = Append(Sequence["\phantom{1}", A, 1, maxRows + 1], "Total Area")
col1 = Join({{(("\cellcolor{" * colorPURPLE) * "}{Purple}")}, Sequence[If[A ≤ Length[data1], ("~" * data1(A)), ""], A, 1, maxRows], {(If[Sum[data1] < 10, "~", ""] * Sum[data1])}})
col2 = Join({{(("\cellcolor{" * colorORANGE) * "}{Orange}")}, Sequence[If[A ≤ Length[data2], ("~" * data2(A)), ""], A, 1, maxRows], {(If[Sum[data2] < 10, "~", ""] * Sum[data2])}})
col3 = Join({{(("\cellcolor{" * colorGRAY) * "}{Gray}")}, Sequence[If[A ≤ Length[data3], ("\,\,\," * data3(A)), ""], A, 1, maxRows], {(If[Sum[data3] < 10, "\,\,\,", ""] * Sum[data3])}})
AnchorA: (0, 0)
poly11 = Polygon({(1, 7), (1, 4), (2, 3), (2, 6), (3, 7)})
poly12 = Polygon({(3, 6), (6, 6), (7, 5), (7, 7), (4, 7)})
poly13 = Polygon({(1, 3), (1, 1), (4, 1), (5, 2), (2, 2)})
poly14 = Polygon({(5, 1), (7, 1), (7, 4), (6, 5), (6, 2)})
poly15 = Polygon({(2, 5), (3, 5), (4, 4), (3, 4)})
poly16 = Rotate(poly15, (3 * pi / 2), (4, 4))
poly17 = Rotate(poly15, pi, (4, 4))
poly21 = Polygon({(2, 5), (4, 7), (5, 7), (4, 8), (2, 6)})
poly22 = Rotate(poly21, ((-pi)) / 2, (4, 4))
poly23 = Rotate(poly21, (-pi), (4, 4))
poly24 = Rotate(poly21, pi / 2, (4, 4))
poly18 = Rotate(poly15, pi / 2, (4, 4))
poly25 = Polygon({(4, 4), (4, 5), (3, 6), (3, 5)})
poly26 = Rotate(poly25, ((-pi)) / 2, (4, 4))
poly27 = Rotate(poly25, pi, (4, 4))
poly28 = Rotate(poly25, pi / 2, (4, 4))
poly31 = Polygon({(0, 4), (0, 8), (4, 8), (3, 7), (1, 7), (1, 5)})
poly32 = Rotate(poly31, ((-pi)) / 2, (4, 4))
poly33 = Rotate(poly31, pi, (4, 4))
poly34 = Rotate(poly31, pi / 2, (4, 4))
poly35 = Polygon({(2, 3), (2, 5), (3, 4)})
poly36 = Rotate(poly35, ((-pi)) / 2, (4, 4))
poly37 = Rotate(poly35, pi, (4, 4))
poly38 = Rotate(poly35, pi / 2, (4, 4))
poly39 = Polygon({(2, 5), (3, 5), (3, 6)})
poly39b = Rotate(poly39, ((-pi)) / 2, (4, 4))
poly39c = Rotate(poly39, pi, (3.9816581927706727, 3.9816581927706722))
poly39d = Rotate(poly39, pi / 2, (4, 4))
outlines = Flatten(Sequence[Zip[Rotate[A, B, (4, 4)], A, {poly11, poly15, poly21, poly25, poly31, poly35, poly39}], B, 0, (3 * pi / 2), pi / 2])
outlineIndex = NaN
highlight: outlines(outlineIndex)
polyNameExtensions: {"11", "12", "13", "14", "15", "16", "17", "18", "21", "22", "23", "24", "25", "26", "27", "28", "31", "32", "33", "34", "35", "36", "37", "38", "39", "39b", "39c", "39d"}
cmdResetLayers = Zip((("SetLayer(poly" * A) * ",4)"), A, polyNameExtensions)
cmdUnlockPieces = Zip((("SetFixed(poly" * A) * ",true,true)"), A, polyNameExtensions)
pieceType = Mod(outlineIndex, 7)
numSquares = Element({0, 3, 0, 0, 0, 5, 0, 0}, pieceType + 1)
numTriangles = Element({1, 2, 2, 5, 2, 2, 2, 1}, pieceType + 1)
currentArea: (numTriangles * 0.5) + numSquares
LegendAnchor = (0.13526330836501313, 8.840494368822926)
legendSquare = Polygon({LegendAnchor, LegendAnchor + (1, 0), LegendAnchor + (1, 1), LegendAnchor + (0, 1)})
legendTriangle = Polygon({LegendAnchor + (4, 0), LegendAnchor + (5, 0), LegendAnchor + (5, 1)})
cmdAddData: {If[Defined[pieceType], (((("SetValue(data" * Element[{3, 1, 1, 2, 2, 3, 3, 3}, pieceType + 1]) * ",Append(data") * Element[{3, 1, 1, 2, 2, 3, 3, 3}, pieceType + 1]) * ",currentArea))"), ""]}
textCalc: "\textsf{This piece is composed of\\" + (LaTeX[If[numTriangles > 0, (((("\(" * numTriangles) * "\) triangle") * If[numTriangles > 1, "s", ""]) * If[numSquares > 0, " and ", ""])]]) + "" + (LaTeX[If[numSquares > 0, ((("" * numSquares) * " square") * If[numSquares > 1, "s", ""])]]) + ".\\
\(\begin{align}\mbox{Area}&=" + (LaTeX[If[numTriangles > 0, ((("" * numTriangles) * "\times 0.5") * If[numSquares > 0, "+", ""])]]) + " " + (LaTeX[If[numSquares > 0, (("" * numSquares) * "\times 1"), ""]]) + "
\\&=" + (LaTeX[currentArea]) + "\mbox{ square unit" + (LaTeX[If[currentArea ≠ 1, "s"]]) + "}\end{align}\)}"
totalArea: Sum[data1] + Sum[data2] + Sum[data3]
tableFormatStr: "vl|1111\_11" + (LaTeX[zeroStr]) + "1"
dataTable = TableText(col0, col1, col2, col3, tableFormatStr)
tabOrder: {textInstruc, poly31, poly21, poly32, poly11, poly12, poly39, poly36, poly39b, poly22, poly24, poly35, poly15, poly25, poly16, poly26, poly37, poly14, poly28, poly18, poly27, poly17, poly34, poly13, poly39d, poly38, poly39c, poly23, poly33, textTitle, dataTable, textCalc, btnReset}
color1: {}
color1pieces = Flatten(Sequence[Zip[Rotate[A, B, (4, 4)], A, {poly11, poly15}], B, 0, (3 * pi / 2), pi / 2])
color2pieces = Flatten(Sequence[Zip[Rotate[A, B, (4, 4)], A, {poly21, poly25}], B, 0, (3 * pi / 2), pi / 2])
color3Pieces = Flatten(Sequence[Zip[Rotate[A, B, (4, 4)], A, {poly31, poly35, poly39}], B, 0, (3 * pi / 2), pi / 2])
coversShowing: {true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true}
allCovers = Sequence(true, i, 1, 28)
quiltGrid = Join({Sequence[Segment[AnchorA + (i, 0), AnchorA + (i, 8)], i, 1, 7], Sequence[Segment[AnchorA + (0, i), AnchorA + (8, i)], i, 1, 7]})