Post Reply 
IDEA: SCRIPTS ON HP-PRIME
01-15-2017, 01:59 AM (This post was last modified: 02-15-2017 02:51 AM by compsystems.)
Post: #1
IDEA: SCRIPTS ON HP-PRIME
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
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)
> (x^2+x-2)
> (x^2+x-2-4)
> (x^2+x-6

[Image: hp_prime_script1_image0.png]


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 

[Image: hp_prime_script1_image1.png]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
IDEA: SCRIPTS ON HP-PRIME - compsystems - 01-15-2017 01:59 AM
RE: IDEA: SCRIPTS ON HP-PRIME - Arno K - 02-06-2017, 08:55 PM
RE: IDEA: SCRIPTS ON HP-PRIME - mark4flies - 02-08-2017, 02:34 AM
RE: IDEA: SCRIPTS ON HP-PRIME - Arno K - 02-08-2017, 09:10 PM
RE: IDEA: SCRIPTS ON HP-PRIME - Han - 02-09-2017, 09:44 PM
RE: IDEA: SCRIPTS ON HP-PRIME - eried - 02-12-2017, 10:23 PM



User(s) browsing this thread: 2 Guest(s)