a is 0;
b is 0;
c is 0;
d is 0;
e is 0;
f is 0;
g is 0;
h is 0;
i is 0;
a1 is 0;
b1 is 0;
c1 is 0;
d1 is 0;
e1 is 0;
f1 is 0;
g1 is 0;
h1 is 0;
i1 is 0;
Button1 is Button("button1", "New problem", 900, 80, true);
proc OpforButton1 : button1_clicked {
a is floor(random()*(10));
b is floor(random()*(10));
c is floor(random()*(10));
d is floor(random()*(10));
e is floor(random()*(10));
f is floor(random()*(10));
g is floor(random()*(10));
h is floor(random()*(10));
i is floor(random()*(10));
a1 is floor(random()*(10));
b1 is floor(random()*(10));
c1 is floor(random()*(10));
d1 is floor(random()*(10));
e1 is floor(random()*(10));
f1 is floor(random()*(10));
g1 is floor(random()*(10));
h1 is floor(random()*(10));
i1 is floor(random()*(10));
};
Button2 is Button("button2", "Add", 900, 120, true);
proc OpforButton2 : button2_clicked {
a3 is (a + a1);
b3 is (b + b1);
c3 is (c + c1);
d3 is (d + d1);
e3 is (e + e1);
f3 is (f + f1);
g3 is (g + g1);
h3 is (h + h1);
i3 is (i + i1);
};
Button3 is Button("button3", "Subtract", 900, 160, true);
proc OpforButton3 : button3_clicked {
a2 is ((a - a1));
b2 is ((b - b1));
c2 is ((c - c1));
d2 is ((d - d1));
e2 is (e - e1);
f2 is (f - f1);
g2 is (g - g1);
h2 is (h - h1);
i2 is (i - i1);
};
Button4 is Button("button4", "Multiply", 900, 200, true);
proc OpforButton4 : button4_clicked {
a4 is ((a*a1)+(b*d1)+(c*g1));
b4 is ((a*b1)+(b*e1)+(c*h1));
c4 is ((a*c1)+(b*f1)+(c*i1));
d4 is ((d*a1)+(e*d1)+(f*g1));
e4 is ((d*b1)+(e*e1)+(f*h1));
f4 is ((d*c1)+(e*f1)+(f*i1));
g4 is ((g*a1)+(h*d1)+(i*g1));
h4 is ((g*b1)+(h*e1)+(i*f1));
i4 is ((g*c1)+(h*f1)+(i*i1));
};
matrixA is Div(
"matrixa", 10, 10, 100, 100,"
" // str(a) // " |
" // str(b) // " |
" // str(c) // " |
" // str(d) // " |
" // str(e) // " |
" // str(f) // " |
" // str(g) // " |
" // str(h) // " |
" // str(i) // " |
");
matrixB is Div(
"matrixb", 250, 20, 100, 100,"
" // str(a1) // " |
" // str(b1) // " |
" // str(c1) // " |
" // str(d1) // " |
" // str(e1) // " |
" // str(f1) // " |
" // str(g1) // " |
" // str(h1) // " |
" // str(i1) // " |
");
matrixC is Div(
"matrixc", 10, 300, 100, 100,"
" // str(a2) // " |
" // str(b2) // " |
" // str(c2) // " |
" // str(d2) // " |
" // str(e2) // " |
" // str(f2) // " |
" // str(g2) // " |
" // str(h2) // " |
" // str(i2) // " |
");
matrixD is Div(
"matrixd",260 , 300, 100, 100,"
" // str(a3) // " |
" // str(b3) // " |
" // str(c3) // " |
" // str(d3) // " |
" // str(e3) // " |
" // str(f3) // " |
" // str(g3) // " |
" // str(h3) // " |
" // str(i3) // " |
");
matrixE is Div(
"matrixb", 350, 300, 100, 100,"
" // str(a4) // " |
" // str(b4) // " |
" // str(c4) // " |
" // str(d4) // " |
" // str(e4) // " |
" // str(f4) // " |
" // str(g4) // " |
" // str(h4) // " |
" // str(i4) // " |
");
picture is [matrixA, matrixB,matrixC, matrixD, Button1, Button2, Button3, Button4];