x

#4D4D4D

$\text{Check}$

$\text{NEW TREASURE}$

Fix position and allow selection for all text objects

Empty all input boxes

\text{This is the answer.}

Reset app

\text{This is the error specific hint}

#006758

#B00020

#252525

#757575

#949494

#E44461

#DA2570

#E66B9E

#3A6ED6

#5991FF

#008475

#0F8538

#00a83c

#5145A8

#8575FF

#903D14

#BD6C43

#C75000

#E07415

\text{This is the general hint}

#eeeeee

#2E006758

#2EB00020

\text{Drag to start}

\text{Enter the coordinates of 
the\treasure to tell the 
boat\where to move.}

\textsf{The first 
coordinate\is the 
horizontal one.}

go

$\text{Treasure:}$

#6557D2

y

\text{The treasure is not that far away!\Try entering different coordinates.}

allRandomSeeds = RandomUniform(0, 0.99, 200)
countQuestion = 0
numRandoms: 2
randIndex: (Mod[countQuestion, floor(Length[allRandomSeeds] / numRandoms)] * numRandoms) + 1
currentRandomSeeds = Take(allRandomSeeds, randIndex, randIndex + numRandoms - 1)
RAns1: -6 + floor((currentRandomSeeds(1) * 12)) + If[floor((currentRandomSeeds(1) * 12)) ≥ 6, 1, 0]
signX = If(RAns1 > 0, "positive", "negative")
RAns2: -6 + floor((currentRandomSeeds(2) * 12)) + If[floor((currentRandomSeeds(2) * 12)) ≥ 6, 1, 0]
helpTextQuadrant = If(RAns1 > 0, If[RAns2 > 0, "I", "IV"], If[RAns2 > 0, "II", "III"])
signY = If(RAns2 > 0, "positive", "negative")
showsolution = false
validate = false
InputPoint: (NaN, NaN)
inputCurrent: {InputPoint}
input1: x(inputCurrent(1))
input2: y(inputCurrent(1))
destValid: input1 ≥ -7 ∧ input1 ≤ 7 ∧ input2 ≥ -6 ∧ input2 ≤ 6
onboarding = false
inputSaved: {NaN}
PMoveA = (3.4347091871177713, 5.572495645015256)
randomNum1: RAns1
correct1: input1 ≟ randomNum1
showanswer = false
tries_{2} = 0
countCorrect = 0
showhint = false
randomNum2: RAns2
correct2: input2 ≟ randomNum2
correct: correct1 ∧ correct2
showbuttons = true
typicalError1: 0
typicalError2: 0
showhinttypicalerror = false
pixelsRight: 16
pixelsLeft: 16
pixelsBottom: 16
pixelsTop: 24
borderBox = Polygon(Zip[PixelsToPoint[Corner[1], Corner[3], Corner[5], A], A, {(pixelsLeft, pixelsTop), (pixelsLeft, y(Corner[5]) - pixelsBottom), Corner[5] - (pixelsRight, pixelsBottom), (x(Corner[5]) - pixelsRight, pixelsTop)}])
layoutY: 192
layoutX: 500
layoutAppSize = Corner(5)
enableBtnValidate: inputCurrent ≠ inputSaved ∧ inputCurrent ≟ RemoveUndefined[inputCurrent] ∧ (¬onboarding)
PMoveB = (4.1638207264560645, 6.136241785204535)
displaySegment = Segment(PMoveA, PMoveB)
StartA = (3.4347091871177713, 5.572495645015256)
StartB = (4.1638207264560645, 6.136241785204535)
pulsingSpeed: 8
pulsing = 0.5 (slider from 0 to 1, step 0.1)
haloPixels: (pulsing * 7)
count = 2
pulsingObject = expandSegment(PMoveA, PMoveB, (pulsing * 7), Corner[1], Corner[3], Corner[5])
onboardingCase: 1
onboardingX: 337
onboardingY: 150
OnboardingTextOffset = onboardingTextOffset(Corner[onboardingText, 1], Corner[onboardingText, 3], onboardingCase, Corner[1], Corner[3], Corner[5])
onboardingDisplayText: "" + (LaTeX[onboardingText]) + ""
yDepart = -7
xDepart = 7
yDest = 4
xDest = 1
t = 0 (slider from 0 to 1, step 0.01)
RAns: (RAns1, RAns2)
BoatPos: ((xDepart, yDepart) * (1 - t)) + ((xDest, yDest) * t)
showsolution_{1} = false
tries = 0
showhint_{1} = false
showbuttons_{1}: true
AppSize = Corner(5)
speed: 5
xStart: 9
yStart: -7
InputBox1 = Textfield(InputPoint)
labelBtnValidate: "\text{CHECK (" + (LaTeX[3 - tries]) + ")}"
helpTextHint: "\textsf{Since the treasure is in Quadrant " + (LaTeX[helpTextQuadrant]) + ",}\\
\textsf{the }x\textsf{-coordinate is " + (LaTeX[signX]) + " and} \\
\textsf{the }y\textsf{-coordinate is " + (LaTeX[signY]) + ".}"
hintQuadrantBox = Polygon({(0, 0), (If[RAns1 > 0, 8, -8], 0), (If[RAns1 > 0, 8, -8], If[RAns2 > 0, 7, -7]), (0, If[RAns2 > 0, 7, -7])})
showinputerror: validate ∧ (¬destValid) ∧ (¬showsolution) ∧ tries < 3
ChestC1: RAns + (-0.75, -0.52)
ChestC2: RAns + (0.75, -0.52)
BoatC2: BoatPos + (0.95, -0.55)
BoatC1: BoatPos + (-0.95, -0.55)
viewBox = Polygon({PixelsToPoint[Corner[1], Corner[3], Corner[5], (16, 40)], PixelsToPoint[Corner[1], Corner[3], Corner[5], (470, 40)], PixelsToPoint[Corner[1], Corner[3], Corner[5], (470, 500 - 64)], PixelsToPoint[Corner[1], Corner[3], Corner[5], (16, 500 - 64)]})
xMin: -7.3
yMin: -8.45
yMax: 7.72
xMax: 24.32 + xMin
axisX = Segment((-7.4, 0), (7.4, 0))
axisY = Segment((0, -6.5), (0, 6.55))
animating: t < 1
isTypicalError: input2 ≟ RAns1 ∧ input1 ≟ RAns2 ∧ RAns1 ≠ RAns2
textFeedback: "" + (LaTeX[If[correct, "$\text{✓ Correct}$", "$\text{✕ " + (If[tries < 3, "No treasure here!", "Maybe next time"]) + "}$"]]) + ""
textHint: "\textsf{\color{" + (LaTeX[colorOrange]) + "}\bold{Hint}}\\" + (LaTeX[If[showhinttypicalerror, helpTextHintTypicalError]]) + "" + (LaTeX[If[showhint ∧ showhinttypicalerror, "\\"]]) + "" + (LaTeX[If[showhint, helpTextHint]]) + ""
textCountCorrect: "\text{Treasures found: " + (LaTeX[countCorrect]) + "}"
enableInput: tries < 3 ∧ (¬(validate ∧ correct)) ∧ ((¬animating) ∨ t ≟ 0)
textSolution: "\text{\bold{Solution}\\
You can locate the 
treasure
\\at the point \bold\(" + (LaTeX[RAns]) + "\).
}"

Tool: PixelsToPoint
PixelsToPoint(Corner1,Corner3,Corner5,PixelCoords)
Input: Corner1, Corner3, Corner5, InputPixels
Output: OutputPoint

InputPixels: (100, 200)
xRight: x(Corner3)
xLeft: x(Corner1)
yTop: y(Corner3)
yBottom: y(Corner1)
yCoord: yTop - (y(InputPixels) / y(Corner5) * (yTop - yBottom))
xCoord: (x(InputPixels) / x(Corner5) * (xRight - xLeft)) + xLeft
OutputPoint: (xCoord, yCoord)

Tool: expandSegment
expandSegment(A,B,pixelGap,Corner1,Corner3,Corner5)
Input: A, B, pixelGap, Corner1, Corner3, Corner5
Output: newPoly

distanceX: (pixelGap / x(Corner5) * (x(Corner3) - x(Corner1)))
distanceY: (pixelGap / y(Corner5) * (y(Corner3) - y(Corner1)))
pointGap: distanceX
xyScale: distanceY / distanceX
A: (0, 0)
vecAB: B - A
pVec: (20 * UnitVector[(((-y(vecAB))) / xyScale, (x(vecAB) * xyScale))])
pVecAngle = Angle(xAxis, Line[(0, 0), pVec])
realAngle = If(pVecAngle ≟ pi / 2 ∨ pVecAngle ≟ (3 * pi / 2), pVecAngle, atand(tan(pVecAngle) / xyScale))
curveFunction = CurveCartesian((pointGap * cos(u)), ((pointGap * xyScale) * sin(u)), u, 0, (2 * pi))
K: curveFunction(realAngle)
vSpace = Vector(K)
allPoints: {A + vSpace, A - vSpace, B - vSpace, B + vSpace}
newPoly = Polygon(allPoints)

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: PixelsToPoint (command PixelsToPoint1)
PixelsToPoint(Corner1,Corner3,Corner5,PixelCoords)
Input: Corner1, Corner3, Corner5, InputPixels
Output: OutputPoint

InputPixels: (100, 200)
xRight: x(Corner3)
xLeft: x(Corner1)
yTop: y(Corner3)
yBottom: y(Corner1)
yCoord: yTop - (y(InputPixels) / y(Corner5) * (yTop - yBottom))
xCoord: (x(InputPixels) / x(Corner5) * (xRight - xLeft)) + xLeft
OutputPoint: (xCoord, yCoord)

Tool: PixelsToPoint (command PixelsToPoint11)
PixelsToPoint(Corner1,Corner3,Corner5,PixelCoords)
Input: Corner1, Corner3, Corner5, InputPixels
Output: OutputPoint

InputPixels: (100, 200)
xRight: x(Corner3)
xLeft: x(Corner1)
yTop: y(Corner3)
yBottom: y(Corner1)
yCoord: yTop - (y(InputPixels) / y(Corner5) * (yTop - yBottom))
xCoord: (x(InputPixels) / x(Corner5) * (xRight - xLeft)) + xLeft
OutputPoint: (xCoord, yCoord)

Tool: PixelsToPoint (command PixelsToPoint2)
PixelsToPoint(Corner1,Corner3,Corner5,PixelCoords)
Input: Corner1, Corner3, Corner5, InputPixels
Output: OutputPoint

InputPixels: (100, 200)
xRight: x(Corner3)
xLeft: x(Corner1)
yTop: y(Corner3)
yBottom: y(Corner1)
yCoord: yTop - (y(InputPixels) / y(Corner5) * (yTop - yBottom))
xCoord: (x(InputPixels) / x(Corner5) * (xRight - xLeft)) + xLeft
OutputPoint: (xCoord, yCoord)

Tool: PixelsToPoint (command PixelsToPoint3)
PixelsToPoint(Corner1,Corner3,Corner5,PixelCoords)
Input: Corner1, Corner3, Corner5, InputPixels
Output: OutputPoint

InputPixels: (100, 200)
xRight: x(Corner3)
xLeft: x(Corner1)
yTop: y(Corner3)
yBottom: y(Corner1)
yCoord: yTop - (y(InputPixels) / y(Corner5) * (yTop - yBottom))
xCoord: (x(InputPixels) / x(Corner5) * (xRight - xLeft)) + xLeft
OutputPoint: (xCoord, yCoord)