Right now, the Prime just has PRINT(), which can clear the screen, or print a line of text. There's also the INPUT() function, but that displays full-screen input forms, much like INFORM on the 48.
Are there any libraries floating around that provide more traditional interactive terminal I/O? Like the sort of thing you'd get with Disp/Input on a TI, or Write/WriteLn/ReadLn in Turbo Pascal, or PRINT/INPUT in just about any old version of BASIC.
Hello, this is a very requested requirement, I do not know what is the difficulty of incorporating it, hardware?
The first step is to include xcas printf cmd
An example of code between HP-PRIME_XCAS and XCAS, notice how difficult and ugly/primitive it is to read mathematical expressions in 1D
XCAS HPPRIME CODE
PHP Code:
#cas
terminalViewTest():=
begin
local x, y;
assume( x, symbol );
assume( y, symbol );
autosimplify(nop);
DispG;
ClrIO;
print( "Terminal View, 2D printing" );
print( "" );
print( "Expr0:" );
print( (x^3-6*x^2+11*x-6 | x=y) + (x^4-x^3-6*x^2+11*x-6)/x^6);
print( "" );
print( "Expr1:" ); print( "" ); f(x):=x^3-2*x^2+1*x-1;
print( 'f(x)' ); print( "" );
print( f(x) );print( "" );
print( "" );
print( "Expr2:" ); print( "" );
print( 'f(x) | x=y' ); print( "" );
print( 'x^3-2*x^2+1*x-1 | x=y' ); print( "" );
print( f(x) | x=y ); print( "" );
print( 'f(y)' ); print( "" );
print( f(y) ); print( "" );
print( "" );
print( "Expr3:" ); g(x):=1/(x+3);
print( 'g(x)' ); print( "" );;
print( g(x) ); print( "" );
print( "" );
print( "Expr4:" );
print( 'f(g(x))' ); print( "" );
print( f(g(x)) ); print( "" );
print( "" );
print( "Expr5:" );
print( 'g(f(x))' ); print( "" );
print( g(f(x)) ); print( "" );
return "Done";
end;
#end
XCAS CODE
PHP Code:
terminalViewTest():={
local x, y;
assume( x, symbol );
assume( y, symbol );
autosimplify( nop) ;
DispG;
ClrIO;
printf( "Terminal View, 2D printing" );
printf( "" );
printf( "Expr0:" );
printf( (x^3-6*x^2+11*x-6 | x=y) + (x^4-x^3-6*x^2+11*x-6)/x^6);
printf( "" );
printf( "Expr1:" ); printf( "" ); f(x):=x^3-2*x^2+1*x-1;
printf( 'f(x)' ); printf( "" );
printf( f(x) );printf( "" );
printf( "" );
printf( "Expr2:" ); printf( "" );
printf( 'f(x) | x=y' ); printf( "" );
printf( 'x^3-2*x^2+1*x-1 | x=y' ); printf( "" );
printf( f(x) | x=y ); printf( "" );
printf( 'f(y)' ); printf( "" );
printf( f(y) ); printf( "" );
printf( "" );
printf( "Expr3:" ); g(x):=1/(x+3);
printf( 'g(x)' ); printf( "" );;
printf( g(x) ); printf( "" );
printf( "" );
printf( "Expr4:" );
printf( 'f(g(x))' ); printf( "" );
printf( f(g(x)) ); printf( "" );
printf( "" );
printf( "Expr5:" );
printf( 'g(f(x))' ); printf( "" );
printf( g(f(x)) ); printf( "" );
return "Done";
}:;
poll
Is anyone else interested in having a better terminal view?
.
(07-26-2018 03:56 PM)compsystems Wrote: [ -> ]The first step is to include xcas printf cmd
That's a great idea, although I guess the Terminal widget will only support the current plain text output, like a traditional terminal. Displaying textbook-formatted output would require a different sort of widget more like the notebook format used for interactive calculations.