Post Reply 
Auto scroll the terminal window
12-22-2014, 11:30 PM (This post was last modified: 12-23-2014 02:46 AM by compsystems.)
Post: #1
Auto scroll the terminal window
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



Find all posts by this user
Quote this message in a reply
12-23-2014, 07:43 AM
Post: #2
RE: Auto scroll the terminal window
Perhaps this thread will help you: http://www.hpmuseum.org/cgi-sys/cgiwrap/...ead=257264
Find all posts by this user
Quote this message in a reply
12-24-2014, 07:44 AM
Post: #3
RE: Auto scroll the terminal window
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
Find all posts by this user
Quote this message in a reply
01-02-2015, 04:41 PM
Post: #4
RE: Auto scroll the terminal window
What's wrong with INPUT, EDITLIST, EDITMAT, Ans(n), Spreadsheets and all the app fields?
Find all posts by this user
Quote this message in a reply
Post Reply 




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