Math Problems{<!--Main values-->\
(set: $time to 0.001s)\
(set: $hue to 310.04)\
(set: $saturation to 0.7)\
(set: $lightness to 0.7)\
\
(display: "changeUnits")\
\
<!--Standard deviations-->\
(set: $hueSD to (50*$hueChangeUnit))\
(set: $saturationSD to (0*$saturationChangeUnit))\
(set: $lightnessSD to (0*$lightnessChangeUnit))\
\
(display: "ceilingAndBasement")\
\
<!--Initial direction-->\
(set: $hueGoUp to true)\
(set: $saturationGoUp to true)\
(set: $lightnessGoUp to true)}\
\
[(set: $hsl to (hsl:$hue,$saturation,$lightness))]<hsl|\
(display: "hslAnimationCalculations")(set: $hueChangeUnit to 1)\
(set: $saturationChangeUnit to (1/360))\
(set: $lightnessChangeUnit to (1/360))(set: $hueCeiling to ($hue+$hueSD))(if: $hueCeiling > 360) [(set: $hueCeiling to (360 - $hueChangeUnit))]\
(set: $hueBasement to ($hue-$hueSD))(if: $hueBasement < 0) [(set: $hueBasement to (0 + $hueChangeUnit))]\
(if: $hueCeiling < $hue)[(set: $hueCeiling to $hue)]\
(if: $hueBasement > $hue)[(set: $hueBasement to $hue)]\
(set: $saturationCeiling to ($saturation+$saturationSD))(if: $saturationCeiling > 1) [(set: $saturationCeiling to (1 - $saturationChangeUnit))]\
(set: $saturationBasement to ($saturation-$saturationSD))(if: $saturationBasement < 0) [(set: $saturationBasement to (0 + $saturationChangeUnit))]\
(if: $saturationCeiling < $saturation)[(set: $saturationCeiling to $saturation)]\
(if: $saturationBasement > $saturation)[(set: $saturationBasement to $saturation)]\
(set: $lightnessCeiling to ($lightness+$lightnessSD))(if: $lightnessCeiling > 1) [(set: $lightnessCeiling to (1 - $lightnessChangeUnit))]\
(set: $lightnessBasement to ($lightness-$lightnessSD))(if: $lightnessBasement < 0) [(set: $lightnessBasement to (0 + $lightnessChangeUnit))]\
(if: $lightnessCeiling < $lightness)[(set: $lightnessCeiling to $lightness)]\
(if: $lightnessBasement > $lightness)[(set: $lightnessBasement to $lightness)]{(live: $time)[\
<!--Hue-->\
(if:$hue >= $hueCeiling)[(set: $hueGoUp to false)]\
(else-if:$hue <= $hueBasement)[(set: $hueGoUp to true)]
(if:$hueGoUp is true)[(set: $hue to it + $hueChangeUnit)]
(else-if: $hueGoUp is false)[(set: $hue to it - $hueChangeUnit)]\
<!--Saturation-->\
(if:$saturation >= $saturationCeiling)[(set: $saturationGoUp to false)]\
(else-if:$saturation <= $saturationBasement)[(set: $saturationGoUp to true)]
(if:$saturationGoUp is true)[(set: $saturation to it + $saturationChangeUnit)]
(else-if: $saturationGoUp is false)[(set: $saturation to it - $saturationChangeUnit)]\
<!--Lightness-->\
(if:$lightness >= $lightnessCeiling)[(set: $lightnessGoUp to false)]\
(else-if:$lightness <= $lightnessBasement)[(set: $lightnessGoUp to true)]
(if:$lightnessGoUp is true)[(set: $lightness to it + $lightnessChangeUnit)]
(else-if: $lightnessGoUp is false)[(set: $lightness to it - $lightnessChangeUnit)]\
(rerun:?hsl)(rerun:?reward)\
]}(font:"Bangers")[==\
<!--Inputs: three string numbers: first, second and answer.-->\
{(display: "Math problems")}
(set: $solved to 0)\
<center>(text-size:2)+(text-color: $hsl)[(if: $solved is 0)[Ginn's Math Problems!](else-if: $solved is 1)[Ginn's solved 1 problem!](else-if: $solved > 1)[Ginn's solved $solved problems!]]<title|</center>
(set: $congrats to [<center>(text-color: $hsl)+(text-size:2)+(text-style: "bold")[Correct!]</center>])\
<!--Processing: determines whether it's + or -, which has been randomized, then pops up if so.-->\
[\
|=
(text-size:1.5)[(input-box: bind $first, "X",1)]\
=|
(set: $sign to (either: "+","-"))(text-size: 2)[(print: $sign)]
=|=
(text-size:1.5)[(input-box: bind $second, "X",1)]\
=|=
(text-size: 2)[(print:"=")]
=|=
(text-size:1.5)[(input-box: bind $answer, "X",1)]\
|==|
(live: 1s)[(if: $sign is "+")[(set: $actualAnswer to ((num:$first)+(num:$second)))]\
(else-if: $sign is "-")[(set: $actualAnswer to ((num:$first)-(num:$second)))]\
(if: $first is not "" and $second is not "" and $answer is not "")[(if: $sign is "+" and $answer is (str:$actualAnswer))[[$congrats]<reward|\
(display: "rerunButton")]\
(else-if: $sign is "-")[(if: $answer is (str:$actualAnswer))[[$congrats]<reward|\
(display: "rerunButton")]]]]]<maths|
<center>(button:)[(link: "Again!")[(set: $solved to it + 1)(rerun:?title)(rerun: ?maths)]]</center>(font:"Bangers")[==\
<!--Inputs: three string numbers: first, second and answer.-->\
{(display: "Math problems")}
<center>(text-size:2)+(text-color: $hsl)[Ginn's Math Problems!]</center>
(set: $congrats to [<center>(text-color: $hsl)+(text-size:2)+(text-style: "bold")[Correct!]</center>])\
[(input: bind $first, "X====")\
(set: $sign to (either: "+","-"))(text-size: 2)[(print: $sign)]
(input: bind $second, "X====")\
(text-size: 2)[(print:"=")]
(input: bind $answer, "X====")
<!--Processing: determines whether it's + or -, which has been randomized, then pops up if so.-->\
(live: 1s)[(if: $sign is "+")[(set: $actualAnswer to ((num:$first)+(num:$second)))]\
(else-if: $sign is "-")[(set: $actualAnswer to ((num:$first)-(num:$second)))]\
(if: $first is not "" and $second is not "" and $answer is not "")[(if: $sign is "+" and $answer is (str:$actualAnswer))[[$congrats]<reward|\
(display: "rerunButton")]\
(else-if: $sign is "-")[(if: $answer is (str:$actualAnswer))[[$congrats]<reward|\
(display: "rerunButton")]]]]]<maths|
|=
(input-box: "=X=")
=|
(input-box: "=X=")
|==|