a is 0;
b is 0;
c is 0;
d is 0;
i2 is 0;
j2 is 0;
k2 is 0;
Button1 is Button("button1", "New problem", 700, 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));
};
Button2 is Button("button2", "Add the matrices", 700, 120, true);
proc OpforButton2 : button2_clicked {
i1 = (a+e);
j1 = (b+f);
k1 = (c+g);
l1 = (d+h);
i2 = i2 + 1;
};
Button3 is Button("button3", "Subttract the matrices", 700, 160, true);
proc OpforButton3 : button3_clicked {
m = (a-e);
n = (b-f);
o = (c-g);
p = (d-h);
j2 = j2 + 1;
};
Button4 is Button("button4", "Multiply the matrices", 700, 200, true);
proc OpforButton4 : button4_clicked {
i = ((a*e)+(b*g));
j = ((a*f)+(b*h));
k = ((c*e)+(d*g));
l = ((c*f)+(d*h));
k2 = k2 + 1;
};
matrixA is Div(
"matrixa", 10, 10, 200, 200,"
" // str(a) // " |
" // str(b) // " |
" // str(c) // " |
" // str(d) // " |
");
matrixB is Div(
"matrixb", 200,10,200,200,"
" // str(e) // " |
" // str(f) // " |
" // str(g) // " |
" // str(h) // " |
");
matrixC is Div(
"matrixc", 10,200,200,200,"
" // str(i) // " |
" // str(j) // " |
" // str(k) // " |
" // str(l) // " |
");
matrixD is Div(
"matrixd", 410,170,200,200,"
" // str(i1) // " |
" // str(j1) // " |
" // str(k1) // " |
" // str(l1) // " |
");
matrixE is Div(
"matrixe",200 ,200, 200,200,"
" // str(m) // " |
" // str(n) // " |
" // str(o) // " |
" // str(p) // " |
");
picture is [matrixA, matrixB, matrixC, matrixD, matrixE, Button1, Button2, Button3, Button4];