;
q = RandomInteger[{0, 1}];
If[q == 0,
Clear[c, d, f];
c = RandomInteger[{1, 10}];
d = RandomInteger[{1, c - 1}];
f = “?”;
g1 := (Clear; f = c - d; right++(*;EmitSound[Sound[{SoundNote[
“E”,0.5],SoundNote[“C”,0.5],SoundNote[“E”,0.5],SoundNote[“C”,
0.5],SoundNote[“F”,0.5],SoundNote[“E”,0.5],SoundNote[“D”,1]}]]*));
g2 := (Clear; f = “?”; wrong++(*;EmitSound[Sound[{SoundNote[
“G”,0.2],SoundNote[“G”,0.2],SoundNote[“G”,0.2],SoundNote[“Eb”,
7]}]]*));
(*cc=EmitSound[{Sound[SoundNote[“D”]]}];*)
Column[{
Row[{
Dynamic@Button[Style[1, 30], If[c - d == 1, g1, g2]],
Dynamic@Button[Style[2, 30], If[c - d == 2, g1, g2]],
Dynamic@Button[Style[3, 30], If[c - d == 3, g1, g2]],
Dynamic@Button[Style[4, 30], If[c - d == 4, g1, g2]],
Dynamic@Button[Style[5, 30], If[c - d == 5, g1, g2]],
Dynamic@Button[Style[6, 30], If[c - d == 6, g1, g2]],
Dynamic@Button[Style[7, 30], If[c - d == 7, g1, g2]],
Dynamic@Button[Style[8, 30], If[c - d == 8, g1, g2]],
Dynamic@Button[Style[9, 30], If[c - d == 9, g1, g2]],
Dynamic@Button[Style[10, 30], If[c - d == 9, g1, g2]]
}],
Panel[Row[{Text[Style[c, 50]],
Text[Style[“-”, 50]],
Text[Style[d, 50]],
\
Text[Style[“=”, 50]],
\
Text[Style[Dynamic, 50]]}]],
Panel[
Row[{Text[Style["??a??? ???: ", 20]],
Text[Style[Dynamic
, 20, Bold, RGBColor\[0, 0.8, 0]]]}], ImageSize -> {250, 40}], Panel\[Row\[{Text\[Style\["????a??????? ???????: ", 20]], Text\[Style\[Dynamic, 20, Bold, RGBColor\[0.8, 0, 0]]]}], ImageSize -> {250, 40}], Panel\[ Row\[{Text\[ Style\["??????: ", 20]], If\[wrong <= 3, Text\[Style\["1", RGBColor\[0, 0.8, 0], Bold, 20]], If\[ right >= wrong, Text\[Style\["2", Blue, Bold, 20]], If\[ right \< wrong && right > 0, Text\[Style\["3", Purple, Bold, 20]], If\[wrong != 0 && right == 0, Text\[Style\["4", Red, Bold, 20]]]] ]] }], ImageSize -> {250, 40}] }, Alignment -> Center], Clear\[a, b, f]; a = RandomInteger\[{1, 9}]; b = RandomInteger\[{1, 9 - a}]; f = "?"; g1 := (Clear; f = a + b; right++(\*;EmitSound\[Sound\[{SoundNote\[ "E",0.5],SoundNote\["C",0.5],SoundNote\["E",0.5],SoundNote\["C", 0.5],SoundNote\["F",0.5],SoundNote\["E",0.5],SoundNote\["D",1]}]]\*)); g2 := (Clear; f = "?"; wrong++(\*;EmitSound\[Sound\[{SoundNote\[ "G",0.2],SoundNote\["G",0.2],SoundNote\["G",0.2],SoundNote\["Eb", 7]}]]\*)); (\*cc=EmitSound\[{Sound\[SoundNote\["C"]]}];\*) Column\[{ Row\[{ Dynamic@Button\[Style\[1, 30], If\[a + b == 1, g1, g2]], Dynamic@Button\[Style\[2, 30], If\[a + b == 2, g1, g2]], Dynamic@Button\[Style\[3, 30], If\[a + b == 3, g1, g2]], Dynamic@Button\[Style\[4, 30], If\[a + b == 4, g1, g2]], Dynamic@Button\[Style\[5, 30], If\[a + b == 5, g1, g2]], Dynamic@Button\[Style\[6, 30], If\[a + b == 6, g1, g2]], Dynamic@Button\[Style\[7, 30], If\[a + b == 7, g1, g2]], Dynamic@Button\[Style\[8, 30], If\[a + b == 8, g1, g2]], Dynamic@Button\[Style\[9, 30], If\[a + b == 9, g1, g2]], Dynamic@Button\[Style\[10, 30], If\[a + b == 10, g1, g2]] }], Panel\[Row\[{Text\[Style\[a, 50]], Text\[Style\["+", 50]], Text\[Style\[b, 50]], \ Text\[Style\["=", 50]], \ Text\[Style\[Dynamic, 50]]}]], Panel\[ Row\[{Text\[Style\["??a??????? ???????: ", 20]], Text\[Style\[Dynamic
, 20, Bold, RGBColor\[0, 0.8, 0]]]}], ImageSize -> {250, 40}], Panel\[ Row\[{Text\[Style\["????a??????? ???????: ", 20]], Text\[Style\[Dynamic, 20, Bold, RGBColor\[0.8, 0, 0]]]}], ImageSize -> {250, 40}], Panel\[ Row\[{Text\[ Style\["??????: ", 20]], If\[wrong <= 3, Text\[Style\["1", RGBColor\[0, 0.8, 0], Bold, 20]], If\[ right >= wrong, Text\[Style\["2", Blue, Bold, 20]], If\[ right \< wrong && right > 0, Text\[Style\["3", Purple, Bold, 20]], If\[wrong != 0 && right == 0, Text\[Style\["4", Red, Bold, 20]]]] ]] }], ImageSize -> {250, 40}] }, Alignment -> Center] ] ]];