Manipulate[
If[again, op = RandomInteger[{1, 4}];
n = If[nega, RandomChoice[{-1, 1}, 2], 1] If[
op == 4, {Times @@ #, Min[#]}, #] &[
RandomInteger[{1, 99}, {2}]]; again = False; operator = 0];
Grid[{{" ", " ", " "}, {" ",
Column[{Grid[{{n[[1]],
If[operator == 0,
"?", {Style["+", 18], Style["-", 18], Style["\[Times]", 18],
Style["\[Divide]", 18]}[[operator]]], n[[2]],
"=", ({Plus, Subtract, Times, Divide}[[op]]) @@ n}}],
If[operator == 0, Style["please choose", Orange],
If[op == operator, Style["True", RGBColor[.67, .75, .15]],
Style["False", RGBColor[1, .26, 0]]], "other"]}, Center],
" "}, {" ",
" ", " "}},
BaseStyle -> "Subsection"], {{again, True}, {False, True}}, {{nega,
False, "include negative arguments"}, {False, True},
ControlPlacement -> Bottom},
{{operator, 0, ""}, {1 -> Style["+", 18], 2 -> Style["-", 18],
3 -> Style["\[Times]", 18], 4 -> Style["\[Divide]", 18]},
ControlType -> RadioButtonBar}, {{op, 1},
ControlType -> None}, {{n, {5, 1}}, ControlType -> None},
AutorunSequencing -> {3}] ControlType -> None},
AutorunSequencing -> {3}]
Friday, 11 February 2011
Subscribe to:
Posts (Atom)