Join us on Discord!
You can help CodeWalrus stay online by donating here.
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - compsystems

#1
Is easier to understand the code in functional form, ie calling subroutines or a single code without goto, the goto should be used in extreme cases where it is almost impossible to use the functional form.

On the highlighted I mean is show code in various colors on the forum.

PS: I continue with TI68k calculators that allow me to create dialog boxes in TI-BASIC and that have management command pixels. without requiring compilation or learn complex languages as LUA

Hopefully Tinspire developers incorporate "missing" TI68k basic commands


...

I would like you to please test TIedit, in which it is developing
#2
Hello, sorry for my bad English  :-[

The following is a very simple game, the classic guess or deduce a number.

But there is a problem when deploying message in the terminal window, the last messages are not displayed, hopefully in future versions the development group of hpprime solve this problem


Code in Spanish  :-|
EXPORT AdivinarODeducir_Numero()
//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;


Video showing the failure

#3
Hello

Sorry for my bad English, please princetonlion.tibd  can create a version without GOTO, Thanks

I extracted the source code in Unicode format, using Tiedit68k

Please try this latest versión

Tiedit New Beta version 0.7.5.28

http://www.jaimeza.org/Mathematic/TexasInstruments/ti68k/ti68k_SDK/TIEdit075_beta.rar


dodge()
Prgm
  Local s,b,k,c,d,cc,f,i,cc,k,cl,cht,h,spd,l
  {8,10,20,40}→l
  1→b
  1→d
  0→k
  5→spd
  "π"→cc
  "|"→cl
  0→s
  Lbl aa
  2→i
  0→s
  Try
    If s>dghigh[1] Then
      dghigh[2]→dghigh[3]
      dghigh[1]→dghigh[2]
      s→dghigh[1]
    EndIf
    If s>dghigh[2] and s<dghigh[1] Then
      dghigh[2]→dghigh[3]
      s→dghigh[2]
    EndIf
    If s>dghigh[3] and s<dghigh[1] and s<dghigh[2]
      s→dghigh[3]
  Else
    Define dghigh={0,0,0}
  EndTry
  ClrIO
  Disp "Dodge V.2.0","By Princetonlion.tibd","","High Scores",dghigh[1],dghigh[2],dghigh[3]
  Toolbar
    Title "Play",p
    Title "Help"
    Item "Instructions",h
    Item "Credits",crd
    Title "Options",o
    Title "Cheat code",c
    Title "Quit",q
  EndTBar
  Lbl crd
  ClrIO
  Disp "Ported to V200 by Princetonlion.tibd","Agranovskiy 2014","More information: omnimaga.org","","Original by Princetonlion.tibd & T.Wang"
  Pause
  Goto aa
  Lbl o
  ClrIO
  Disp "Options","Your Charactor:",cc,"Your Line Charactor:",cl,"Starting Speed:",i
  Toolbar
    Title "Speed"
    Item "Very Slow",de
    Item "Slow",dm
    Item "Normal",dh
    Title "Characters"
    Item "Custom Player",cc
    Item "Custom Line",cl
    Title "Clear Score",dhs
    Title "Reset Settings",ors
    Title "Back",aa
  EndTBar
  Lbl dhs
  ClrIO
  Disp "Are you sure you want to clear","High scores and score?"
  Toolbar
    Title "Yes",chs
    Title "No",aa
  EndTBar
  Lbl chs
  {0,0,0}→dghigh
  0→s
  Goto o
  Lbl cl
  Request "Custom Line",cl
  left(cl,1)→cl
  Goto o
 
  Lbl cc
  Request "Custom Player",cc
  left(cc,1)→cc
  Goto o
  Lbl de
  3→i
  Goto o
  Lbl dm
  5→i
  Goto o
  Lbl dh
  20→i
  Goto o
  Lbl ors
  2→i
  0→s
  "π"→cc
  "|"→cl
  Lbl c
  ClrIO
  Request "Cheat code",cht
  If cht="123outerme" Then
    Disp "Starting score is 1337"
    1337→s
    Pause
    Goto aa
  EndIf
  Disp "Wrong code!","The code is on omnimaga.org"
  Pause
  Goto aa
  Lbl h
  ClrIO
  Disp "Use arrow keys to move player.","Avoid the lines.Score is saved in dghigh"
  Pause
  Lbl p
  1→b
  1→d
  0→k
  While true
    ClrIO
    Output 84,b,cc
    Output 45,117,s
    rand(234)→d
    rand(234)→f
    b→h
    For c,0,84,i
      Output c,d,cl
      Output c,f,cl
      Output c,h,cl
      If c=80 and (d=b or d=b+1 or d=b+2 or d=b-1 or d=b-2 or f=b or f=b+1 or f=b+2 or f=b-1 or f=b-2 or h=b or h=b+1 or h=b+2 or h=b-1 or h=b-2) Then
        Goto aa
      EndIf
      getKey()→k
      If k≠0 Then
        Output 84,b," "
      EndIf
      If k=340 and b<234 Then
        b+spd→b
        Output 84,b,cc
      EndIf
      If k=337 and b>−7 Then
        b-spd→b
        Output 84,b,cc
      EndIf
      If c=80 and (d=b or d=b+1 or d=b+2 or d=b-1 or d=b-2 or f=b or f=b+1 or f=b+2 or f=b-1 or f=b-2 or h=b or h=b+1 or h=b+2 or h=b-1 or h=b-2) Then
        Goto aa
      EndIf
      Output 45,117,s
      Output 84,b,cc
    EndFor
    s+1→s
    If fPart(s/10)=0
      spd-1→spd
    If i≤8
      i+2→i
    If i≥8
      l[rand(4)]→i
  EndWhile
  Lbl q
  ClrIO
  DispHome
  Stop
EndPrgm


PD: The above code can display color (highlighted)?
Powered by EzPortal