01-15-2017, 01:59 AM
Hello
The scripts (sequence of commands) allow us to show the procedure of math operations without having to create a program.
The idea is to implement it experimentally only in the simulator (in a beginning),
The simulator would have a menu.
Script
/Load
/Run (on CAS history)
What do you think of this idea?
File Script1.hppscr
load Script1.hppscr
run Script1.hppscr
Is executed, sentence by sentence stopping in each one, with the key [enter] or by a menu [continue] [pause]
The script within a program gets complicated. Also the print view does not have pretty-print, while the history does have it.
The scripts (sequence of commands) allow us to show the procedure of math operations without having to create a program.
The idea is to implement it experimentally only in the simulator (in a beginning),
The simulator would have a menu.
Script
/Load
/Run (on CAS history)
What do you think of this idea?
File Script1.hppscr
load Script1.hppscr
PHP Code:
//simplify(none);
(2*x^2-3*x+4) > (3*x^2-2*x-2);
Ans + -2*x^2;
simplify(Ans);
Ans + 3*x;
simplify(Ans);
Ans + -4;
simplify(Ans);
run Script1.hppscr
Is executed, sentence by sentence stopping in each one, with the key [enter] or by a menu [continue] [pause]
PHP Code:
(2*x^2-3*x+4) > (3*x^2-2*x-2)
(2*x^2-3*x+4-2*x^2) > (3*x^2-2*x-2-2*x^2)
(-3*x+4) > (x^2-2*x-2)
(-3*x+4+3*x) > (x^2-2*x-2+3*x)
4 > (x^2+x-2)
0 > (x^2+x-2-4)
0 > (x^2+x-6)
The script within a program gets complicated. Also the print view does not have pretty-print, while the history does have it.
PHP Code:
#cas
script1():=
begin
local expr0;
print;
print("step1:");
expr0 := (2*x^2-3*x+4) > (3*x^2-2*x-2);
print(string(expr0));
print("");
print("step2: +(-2*x^2)");
expr0 := expr0 + -2*x^2; // (3*x^2-2*x-2-2*x^2)<(2*x^2-3*x+4-2*x^2)
print(string(expr0));
expr0 := simplify(expr0); // (-3*x+4)>(x^2-2*x-2) simplification.
print("simplify → " +expr0);
print("");
print("step3: +(3*x)");
expr0 := expr0 + 3*x; // (-3*x+4+3*x)>(x^2-2*x-2+3*x)
print(string(expr0));
expr0 := simplify(expr0); // 4>(x^2+x-2)
print("simplify → "+expr0);
print("");
print("step4: +(-4)");
expr0 := expr0 + -4; // 0>(x^2+x-2-4)
print(string(expr0));
expr0 := simplify(expr0);
print("simplify → "+expr0); // -> 0>(x^2+x-6)
print("");
return expr0;
end;
#~end