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
02-01-2017, 11:46 PM
Post: #2
RE: IDEA: SCRIPTS ON HP-PRIME
The famous ti68k calcs (Unfortunately discontinued), were a product designed for the educational environment, had the option of creating scripts, you can see that at the beginning of the next code before the colon there is a character of commands, which simplify the coding

P: print the result of the statement
C: Execute the current statement
Empty: does not execute anything

PHP Code:
:DelVar ec1ec2
C
:NewProb
C
:ClrHome
 
:Local ec1ec2
 
:{0,0}soly
 
:©// "Find the dimensions of a rectangle whose area is 45 and its perimeter 28"
 
:©// "METHOD 1 (Algebraic solution, stepwise)"
 
:©// "The equations are:"
C:x*y=45ec1
C
:2x+2y=28ec2
C
:factor(ec2)
 :
©// 2*(x+y) = 28
C:ans(1)/2
C
:solve(ans(1),y)
 :
©// y=14-x
C:ec1|(ans(1))
 :
©// x*(-x+14)=45
C:expand(ans(1))
 :
©// -x^2+14*x = 45
C:solve(ans(1),x)
 :
©// x=5 or x=9
C:explist(ans(1),x)solx
 
:©//{ 5, 9 }
C:ec1|x=solx[1]
 :
©// 5*y=45
C:solve(ans(1),y)
 :
©// y=9
C:explist(ans(1),y)[1]soly[1]
 :
©// { 9 }
 
:©// test
C:ec1|x=solx[1] and y=soly[1]
 :
ec2|x=solx[1] and y=soly[1]
:
C:ec1|x=solx[2]
 :
©// 9*y=45
C:solve(ans(1),y)
 :
©// y=5
C:explist(ans(1),y)[1]soly[2]
 :
©// { 5 }
 
:©// test
C:ec1|x=solx[2] and y=soly[2]
 :
ec2|x=solx[2] and y=soly[2]
 :
©solutionsx=y=or x=y=5
 
:
C:©//"METODO2 (Solucion algebraica directa)"
C:solve(ec1 and ec2,{x,y})
 :
C:©METODO3 (Solucion grafica)
C:©//"Despejar y en ambas ecuaciones,graficar las 2 curvas y hallar los puntos de corte."
C:setmode("graph","function")
C:setgraph("axes","on")
C:0xmin:20xmax
C
:0ymin:10ymax
C
:solve(ec1,y)
C:expr("define y1(x)="&string(right(ans(1))))
C:solve(ec2,y)
C:expr("define y2(x)="&string(right(ans(1))))
C:trace
C
:delvar ec1,ec2,sol 



[Image: ti68k_scripts_image0.png]
Find all posts by this user
Quote this message in a reply
02-06-2017, 03:16 PM (This post was last modified: 02-12-2017 01:15 PM by compsystems.)
Post: #3
RE: IDEA: SCRIPTS ON HP-PRIME
I am writing a guide, of sample scripts on ti68k calculators, I hope the hp-prime development group will consider this and incorporate this functionality in the near future (as INSPIRATION NOT CLONING) Inspiration because the SCRIPTS of the ti68k ARE VERY LIMITED, I want to see something more powerful in the HP-PRIME

PDF scripts Guide

TI68K binary files

SCRIPT #01

Solve the following system of two equations and check their solutions.
{y=x^2), y=2·x+3 }

[Image: scripts_on_ti68k_calcs_scr01_image00.png]

[Image: scripts_on_ti68k_calcs_scr01_image02.png]

[Image: scripts_on_ti68k_calcs_scr01_image01.png]

TI68K-CALCS PROGRAM AND SCRIPT EDITOR: http://pengels.bplaced.net/index.php/tiedit
TI68K-CALCS EMULATOR http://lpg.ticalc.org/prj_tiemu/
Find all posts by this user
Quote this message in a reply
02-06-2017, 08:55 PM
Post: #4
RE: IDEA: SCRIPTS ON HP-PRIME
Well, if you like those scripts on a ti-calculator you should use one to write them, my personal opinion: I once, back in 1996,7 or 8 had a ti92-plus, a really clumsy device equipped with an 68k processor, I wrote some scripts for my lessons but found that pupils were not really interested in that, they liked the other possibilities much more: enter for example a function and immediately have zeros, extreme- and turning-points and integrals at hand, so I wrote a standard program for this purpose.
Arno
Find all posts by this user
Quote this message in a reply
02-08-2017, 02:34 AM (This post was last modified: 02-08-2017 02:35 AM by mark4flies.)
Post: #5
RE: IDEA: SCRIPTS ON HP-PRIME
1 +

Go with TI and be happy!
Find all posts by this user
Quote this message in a reply
02-08-2017, 02:56 PM (This post was last modified: 02-08-2017 09:29 PM by compsystems.)
Post: #6
RE: IDEA: SCRIPTS ON HP-PRIME
Arno K Wrote:Well, if you like those scripts on a ti-calculator you should use one to write them


Electronic translation = (

I like the ti68k calculators, but my purpose is to use the calculators as a tool in the classroom, the ti68k calcs do not have an official emulator, those that exist have BUGs and are not viable as projection extension to the board, besides the Ti68k are discontinued, the successor ti-nspireCXCAS have almost all the ti68k commands, but I do not know why developers took the bad decision to remove the dialog boxes cmd, hundreds of programs that I wrote on ti68k I can not still port them, they also eliminated the scripts app

Arno K Wrote:my personal opinion: I once, back in 1996,7 or 8 had a ti92-plus, a really clumsy device equipped with an 68k processor,

Why do you say it's clumsy?

Arno K Wrote:I wrote some scripts for my lessons but found that pupils were not really interested in that, they liked the other possibilities much more: enter for example a function and immediately have zeros, extreme- and turning-points and integrals at hand, so I wrote a standard program for this purpose.

The idea of creating programs INPUT -> OUTPUT are called BLACK BOX, because it hides what it does, are more valuable programs that shows the steps or procedure of solution so that later the student does it by hand.

It is easier to code a script than a program, I first show the scripts and then programs, later I upload the same scripts but codified as programs, it will be observed that they are more extensive
Find all posts by this user
Quote this message in a reply
02-08-2017, 09:10 PM
Post: #7
RE: IDEA: SCRIPTS ON HP-PRIME
Clumsy, that's here used for thick, not well to be handled, too big, equipped with a small screen.
I noticed it is easier to show the pupils step by step on paper, with the calculator they later should check their results, when wrong/different from calculator output, I rechecked and explained, so a script rendered unneccessary.
Arno
Find all posts by this user
Quote this message in a reply
02-09-2017, 05:45 PM (This post was last modified: 02-12-2017 01:26 PM by compsystems.)
Post: #8
RE: IDEA: SCRIPTS ON HP-PRIME
Is true, ti-92, ti-92+, ti-v200 are very thick, their screen is somewhat small, but their CAS (1995) is very good, it is still present in the ti-nspire [CX] CAS (2017)

The scripts is the first step, to start in the computer program, the scripts of the ti68k summarize a code because it pauses sentence by sentence, it avoids to print the entry

Demonstration

Script source code
PHP Code:
C:ClrHome
C
:setFold(scripts1)
C:splitsch() ©"split LCD script:home"
C:DelVar eqseq1eq2,answerslnsXslnX1slnX2slnY1slnY2test1test2
C
:DelVar x,y
C
:©"solve the following system of equations"
C:©"and check their solutions."
C:{ x^22*}→eqs
C
:eqs[1]→eq1
C
:eqs[2]→eq2
C
:(eq2|eq1)→answer
C
:answer - (2*3)→answer
C
:factor(answer)→answer
C
:{ part(left(answer),1)=0,part(left(answer),2)=}→answer
C
:{ answer[1]+3answer[2]-}→slnsX
C
:slnsX[1]→slnX1
C
:slnsX[2]→slnX2
C
:(eqs[1]|slnX1)→slnY1
C
:(eqs[1]|slnX2)→slnY2
C
:(eqs[1]|(slnX1 and slnY1))→test1
C
:(eqs[1]|(slnX2 and slnY2))→test2
C
:test1 and test2
C
:"Solns: ("&string(slnX1)&","&string(slnY1)&") ("&string(slnX2)&","&string(slnY2)&")"
C:DispHome:done 

ported as program
PHP Code:
script1()
()
Prgm
  ClrIO
  setFold
(scripts1)
  
©splitsch() ©"split LCD script:home"
  
DelVar eqs,eq1,eq2,answer,slnsx,slnx1,slnx2,slny1,slny2,test1,test2
  DelVar x
,y
  Disp 
"Solve the following system of equations"
  
Disp "and check their solutions."
  
Disp "▪{y=x^2,y=2*x+3}→eqs"
  
{y=x^2,y=2*x+3}→eqs
  Disp eqs
  Pause
  Disp 
"▪eqs[1]→eq1"
  
eqs[1]→eq1
  Disp eq1
  Pause
  Disp 
"▪eqs[2]→eq2"
  
eqs[2]→eq2
  Disp eq2
  Pause
  Disp 
"▪(eq2|eq1)→answer"
  
eq2|eq1→answer
  Disp answer
  Pause
  Disp 
"▪answer-(2*x+3)→answer"
  
answer-(2*x+3)→answer
  Disp answer
  Pause
  Disp 
"▪factor(answer)→answer"
  
factor(answer)→answer
  Disp answer
  Pause
  Disp 
"▪{part(left(answer),1)=0,part(left(answer),2)=0}→answer"
  
{part(left(answer),1)=0,part(left(answer),2)=0}→answer
  Pause
  Disp 
"▪{answer[1]+3,answer[2]-1}→slnsx"
  
{answer[1]+3,answer[2]-1}→slnsx
  Disp slnsx
  Pause
  Disp 
"▪slnsx[1]→slnx1"
  
slnsx[1]→slnx1
  Disp slnx1
  Pause
  Disp 
"▪slnsx[2]→slnx2"
  
slnsx[2]→slnx2
  Disp slnx2
  Pause
  Disp 
"▪(eqs[1]|slnx1)→slny"
  
eqs[1]|slnx1→slny1
  Disp slny1
  Pause
  Disp 
"▪(eqs[1]|slnx2)→slny2"
  
eqs[1]|slnx2→slny2
  Disp slny2
  Pause
  Disp 
"▪eqs[1]|(slnx1 and slny1)→test1"
  
eqs[1]|slnx1 and slny1→test1
  Disp test1
  Pause
  Disp 
"▪eqs[1]|(slnx2 and slny2)→test2"
  
eqs[1]|slnx2 and slny2→test2
  Disp test2
  Pause
  Disp 
"▪test1 and test2→answer"
  
test1 and test2→answer
  Disp answer
  Pause
 
"Solns: ("&string(slnx1)&","&string(slny1)&") ("&string(slnx2)&","&string(slny2)&")"→answer
  Disp answer
  Pause
EndPrgm 

More than double the instructions to do the same

Then it is important or not the scripts?
The CASIO classPAD has something similar to execute all the history
Find all posts by this user
Quote this message in a reply
02-09-2017, 09:44 PM
Post: #9
RE: IDEA: SCRIPTS ON HP-PRIME
(02-09-2017 05:45 PM)compsystems Wrote:  Then it is important or not the scripts?
The CASIO classPAD has something similar to execute all the history

That is really highly dependent on how students and teachers use the scripts. From an instructor's point of view, it may seem nice -- almost like a live tutor walking a student through a problem. From a student's point of view, it may either a nice tutor (in a sense), or for some, an easy way out of having to actually learn the underlying problem-solving technique. They can merely copy the steps from the script and present it as their own solution without any understanding of what it's doing. How would an instructor, then, know whether their student has truly learned the problem-solving technique being presented through the script vs. simply mimicking what the script does?

In general, each machine will have strengths and weaknesses. But rather than trying to make them all be the same, I would prefer to keep them different and use the appropriate tools for my ever-changing needs. Several unique tools can, in many ways, be better than one generic one.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
02-12-2017, 10:23 PM
Post: #10
RE: IDEA: SCRIPTS ON HP-PRIME
Maybe the suggestion would be a new "halt" command or something like that to allow the user to pause/resume the current program later. (so student can work on the solution).

My website: erwin.ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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