HP Forums
Auto scroll the terminal window - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Auto scroll the terminal window (/thread-2698.html)



Auto scroll the terminal window - compsystems - 12-22-2014 11:30 PM

Hello, sorry for my bad English.

I wish I print text while the terminal will automatically scroll to scroll step execution.

but when it comes to the first page stops and only at the end you can see the results =(

How I can improve the following code, so that the history of the terminal will automatically scroll?

Annex source code

Code:
EXPORT AdivinarODeducir_Numero()
//Juego Matemático versión 0.8 By JaiMeza www.jaimeza.org
//test CAS Version: 1.1.2-11 and Operating System: version 6.2.9200
begin
    // Definición de Variables y tipo de contenedor
    local intentos := 0;
    local total_intentos := 0;
    local num_ingresado :=  0;
    local num_secreto := IP( random ( 1, 100 ) );
    
    print(); 
    print( "*** Ejecución Iniciada. ***" ); freeze;
    wait;
    
    // Presentación
    print( "Juego Matemático versión 0.8" );
    wait;
    print( "El programa genera un número real entre 1 y 100. Trate de deducirlo como recomendación en 8 intentos como máximo" );
    wait;
    
    // Entrada de Datos
    print( "Ingrese el # de intentos personalizados" );
    //freeze;
    wait( 1 );
    if NOT(input( total_intentos,"Total de Intentos","Intentos=","Digite un # como máximo total de intentos" ))
        then
        kill;
    end;
    wait;
    total_intentos := abs(total_intentos); // si el usuario ingresa números negativos se corrige
    print( "Intento #" + total_intentos);
    wait;
    intentos := total_intentos;
    
    print( "solo para hacer pruebas num aleatorio=" + num_secreto); // elimine esta sentencia para jugar verdaderamente
    wait;
    
    if NOT( input( num_ingresado,"Deducir_Numero","Num Ingresado=","Cual es el numero?" ) )
        then kill;
    end;
    print( ">"+num_ingresado );
    
    while( num_secreto <> num_ingresado and intentos > 1 ) do
        if num_secreto > num_ingresado then
            print( "El numero deducido es MENOR que el numero en cuestión" );
            wait;
            else
            print( "El numero deducido es MAYOR que el numero en cuestión" );
            wait;
        end;
        print("");
        
        intentos := intentos - 1; // decrementa en 1 el número de intentos
        print( "Le quedan "+intentos+" intento(s):" );
        print("Intento #" + intentos);
        //freeze;
        wait;
        if NOT( input( num_ingresado,"Deducir_Numero","Num Ingresado=","Cual es el numero?" ) ) then
            kill;
        end;
        print( ">"+num_ingresado );
    end;
    
    if num_secreto <> num_ingresado then
        print( "Perdió! trato en "+ ( ( total_intentos + 1 ) - intentos ) + " intento(s.) :~(, pero el numero era: "+ num_secreto);
        else
        print( "Gano! Usted lo dedujo en: "+ ( ( total_intentos + 1 ) - intentos ) +" intento(s.)" );
    end;
    print( "*** Ejecución Finalizada. ***" );
    
    //freeze;
    return "Done";
    
end;

and video






RE: Auto scroll the terminal window - akmon - 12-23-2014 07:43 AM

Perhaps this thread will help you: http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv021.cgi?read=257264


RE: Auto scroll the terminal window - Snorre - 12-24-2014 07:44 AM

Hello compsystems,

a similiar question arose some time ago in the german Prime forum.
One suggestion was writing an custom "terminal" and replace PRINT in own programs.
I've copied the source to the software library.

Greetings


RE: Auto scroll the terminal window - Snorre - 01-02-2015 04:41 PM

What's wrong with INPUT, EDITLIST, EDITMAT, Ans(n), Spreadsheets and all the app fields?