Jump to content

Photo

TI Classic Programmable Calculators Programs (Not graphing!)

TI 58 TI 59 Programming

19 replies to this topic

#1 Vorticon OFFLINE  

Vorticon

    River Patroller

  • 3,245 posts
  • Location:Eagan, MN, USA

Posted Sun Nov 12, 2017 10:01 AM

I think it's high time to include a section here on the venerable TI 58/59/66/95 calculators as they represent an important legacy :) If you have an interesting program you'd like to share, please post it here.

 

My favorite source of programs for them is the venerable French magazine Jeux & Strategie published in the 80's. I have all of the first 30 classic issues and you can find high quality scans of them here: http://www.abandonwa...?mag=185&page=1 . I never go on a long flight without one of these issues in my bag along with the compact TI 66 to play with!

 

Here's a game called Ricochet from issue 17 (Oct-Nov 1982) to get things started:

 

Attached File  Ricochet.jpeg   734.77KB   1 downloads

 

You have to uncover 4 atoms hidden in an 8x8 grid by sending laser beams through the grid and analyzing the output. The beam can be either deviated or absorbed. The entry and exit points of the laser beam is given by their x,y coordinates.

 

Attached File  Rocochet example.gif   126.93KB   1 downloads

 

In the above example, beam one (0,11) is first deviated then absorbed. Beam 2 (0,15) is deviated and exits from (4,18). And so on. Study the image above closely to deduce how the deviation process works.

 

To run the program, first enter a value between 0 and 1 then press A. After a bit of time 0 will appear on the display, indicating that the atoms have now been hidden. To send a beam, enter first its x coordinate followed by R/S, then its y coordinate followed by R/S again. It can take from a few seconds to several minutes for the calculator to respond. If the beam is absorbed, it will display 0, otherwise its exit point will be displayed as xx.yy. For example, if the exit point is (6,9), the display will show 6.9. Repeat as needed until you think you have uncovered all 4 atoms' locations. You can find out by using RCL 1 to 4, displaying all of the coordinates for the atoms.

To try a new game, enter a new value between 0 and 1 then press A again. Don't forget to RST before running the program!

 

I tested out the program on a TI 66 and it works great! There was a typo in the listing which I corrected in the image on top.



#2 Ksarul OFFLINE  

Ksarul

    River Patroller

  • 4,741 posts

Posted Sun Nov 12, 2017 10:08 AM

Actually, even the SR-56 had 100 steps of program memory, so some simple games fit into it as well. I think I may have a whole book of SR-56 programs around here somewhere. . .



#3 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 3,245 posts
  • Location:Eagan, MN, USA

Posted Sun Nov 12, 2017 11:53 PM

Actually, even the SR-56 had 100 steps of program memory, so some simple games fit into it as well. I think I may have a whole book of SR-56 programs around here somewhere. . .

 

Indeed. There is also an excellent free TI 58/59 emulator for Android called TI5x which also integrates an emulated thermal printer with export capabilities.

 

Here's a small program I wrote yesterday that demonstrates the convergence to 1 of any integer. Take an integer, divide it by 2 if it is even, or multiply it by 3 then add 1 if it is odd. Repeat the process and eventually you will end up with 1. There is no formal proof to date that this applies to all integers, although no one has yet been able to find an exception. Some integers require a large number of steps to converge, while others relatively few, and size is not predictive. For example, 27 requires 111 steps whereas 28 requires only 18...

Enter an integer then press R/S. The convergence sequence will be printed out on the printer as well as the total number of steps needed.

       000  47 CMS  
       001  76 LBL  
       002  12  B   
       003  42 STO  
       004  01  01  
       005  99 PRT  
       006  25 CLR  
       007  32 X⇌T  
       008  43 RCL  
       009  01  01  
       010  55  ÷   
       011  02  2   
       012  95  =   
       013  22 INV  
       014  59 INT  
       015  67  EQ  
       016  13  C   
       017  43 RCL  
       018  01  01  
       019  65  ×   
       020  03  3   
       021  85  +   
       022  01  1   
       023  95  =   
       024  69 OP   
       025  22  22  
       026  61 GTO  
       027  12  B   
       028  76 LBL  
       029  13  C   
       030  01  1   
       031  32 X⇌T  
       032  43 RCL  
       033  01  01  
       034  55  ÷   
       035  02  2   
       036  95  =   
       037  69 OP   
       038  22  22  
       039  67  EQ  
       040  14  D   
       041  61 GTO  
       042  12  B   
       043  76 LBL  
       044  14  D   
       045  99 PRT  
       046  43 RCL  
       047  02  02  
       048  98 ADV  
       049  99 PRT  
       050  98 ADV  
       051  91 R/S    

           7.       
          22.       
          11.       
          34.       
          17.       
          52.       
          26.       
          13.       
          40.       
          20.       
          10.       
           5.       
          16.       
           8.       
           4.       
           2.       
           1.       

          16.       




#4 apersson850 OFFLINE  

apersson850

    Dragonstomper

  • 501 posts

Posted Thu Nov 16, 2017 10:02 AM

The first programmable device I ever owned was the TI-59 Programmable calculator.

I still have it, but it's no longer working properly.

I have some of the original TI-57 too, which do work.



#5 Keatah ONLINE  

Keatah

    Missile Commander

  • 21,302 posts

Posted Thu Nov 16, 2017 1:06 PM

What's wrong with the ti59?



#6 apersson850 OFFLINE  

apersson850

    Dragonstomper

  • 501 posts

Posted Thu Nov 16, 2017 4:32 PM

With mine? Last time I ckecked it didn't turn on. I haven't investigated any further. Mainly use HP nowadays anyway.

#7 Keatah ONLINE  

Keatah

    Missile Commander

  • 21,302 posts

Posted Fri Nov 17, 2017 12:39 PM

HP calcs are known for their accuracy. Tons of man-hours have gone into getting the last digits right.



#8 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 3,245 posts
  • Location:Eagan, MN, USA

Posted Fri Nov 17, 2017 2:52 PM

I've been wanting to have an RND function for my TI programmables. While the TI 59 master module does include just that, other calculators like the TI 66 and the TI 57 do not accept program modules. My goal was to find a simple function that could be implemented in a minimum of steps so as not to hog too much of the programming memory while maintaining a modicum of uniform distribution.

After some research, I came across what is called the congruential method using the formula

 

ri+1 = (ari + c) mod M

 

r is the seed (any number) entered by the user, while a,c and M are constants. M binds the ranges from 0 to M-1 of the pseudo-random series, and I am using M=10 so I can have digits between 0 and 9. I played quite a bit with different values for a and c, finally settling on a=39.9 and c=1, which gave me as close to uniform function as I could get. It's not perfect at all, but I think it will do the trick for most purposes. Here's the program. Enter the seed in register 01 then press R/S. A random number 0<= n <1 will be displayed. Keep pressing R/S for more numbers. This program can easily be embedded in a larger program to generate random numbers.

       000  76 LBL  
       001  11  A   
       002  43 RCL  
       003  01  01  
       004  65  ×   
       005  03  3   
       006  09  9   
       007  93  .   
       008  09  9   
       009  95  =   
       010  85  +   
       011  01  1   
       012  95  =   
       013  42 STO  
       014  02  02  
       015  55  ÷   
       016  01  1   
       017  00  0   
       018  95  =   
       019  59 INT  
       020  65  ×   
       021  01  1   
       022  00  0   
       023  95  =   
       024  32 X⇌T  
       025  43 RCL  
       026  02  02  
       027  75  -   
       028  32 X⇌T  
       029  95  =   
       030  42 STO  
       031  01  01  
       032  59 INT  
       033  55  ÷   
       034  01  1   
       035  00  0   
       036  95  =   
       037  91 R/S  
       038  61 GTO  
       039  11  A   

In order to visualize the random numbers distribution, I expanded the above program so that it would calculate each number's frequency, and after 100,000 iterations I got the following:

        0.       
        9850.       
           1.       
       10042.       
           2.       
        9901.       
           3.       
       10061.       
           4.       
        9985.       
           5.       
        9985.       
           6.       
       10047.       
           7.       
       10059.       
           8.       
       10032.       
           9.       
       10037.       

Which graphically looks like this:

 

Attached File  TI RND frequency distribution.jpg   74.41KB   1 downloads

 

As can be plainly seen, it's barely passable as a uniform function. 

 

If anyone here has a better compact algorithm I could try, please post it!



#9 ramidavis OFFLINE  

ramidavis

    Chopper Commander

  • 119 posts

Posted Fri Nov 17, 2017 4:54 PM

...


Edited by ramidavis, Tue Jan 2, 2018 10:50 AM.


#10 apersson850 OFFLINE  

apersson850

    Dragonstomper

  • 501 posts

Posted Sat Nov 18, 2017 1:46 PM

The TI 59 has very good calculating accuracy. Among the best in the 1970's.

#11 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 3,245 posts
  • Location:Eagan, MN, USA

Posted Fri Aug 31, 2018 4:20 PM

Here's a program I cobbled together while on vacation recently for the TI 59 calculator. It is pretty large at 945 steps and requires 20 memories. It should be able to run on the TI 95 as well with only some minor modifications. It's an air combat game pitting you against a computer controlled enemy plane, really a simplified version of a similar concept I created for the CC40 computer a while back.

I'm attaching a text listing, instructions, as well as a binary which can be loaded into the TI5x Android app if you happen to have it. You will need to change the extension from .bin to .ti5p. I programmed the game on it and it has a printer emulation as well which is super helpful.

Attached Files



#12 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 3,245 posts
  • Location:Eagan, MN, USA

Posted Mon Sep 3, 2018 2:37 PM

I found an excellent TI 59 Windows emulator by Alain Zanchetta here: http://www.zanchetta...ge=TI59Emulator

 

I have attached a copy of Air War formatted to run on it. Just press INV 2ND WRITE on the calculator to get the loading menu. Make sure to change the .bin extension to .ti59 first.

Attached Files



#13 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 3,245 posts
  • Location:Eagan, MN, USA

Posted Fri Sep 7, 2018 6:59 AM

I found a bug in the Air War program and corrected it. The files above have been updated accordingly. I have also expanded the instructions a bit in order to clarify the gameplay. 



#14 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 3,245 posts
  • Location:Eagan, MN, USA

Posted Fri Sep 7, 2018 8:44 PM

Sadly it turned out that Air War will not run on a real TI 59 calculator because the program needs 20 memories in addition to the 945 program steps. On a real TI 59, each group of 10 memories reduces the number of available program steps by 80, and so I would only have 800 steps available out of the maximum 960 steps the calculator supports. This limitation is apparently not implemented in the emulators. Ti5x allows the full 960 steps as well 99 memories, whereas Alain Zanchetta's Windows emulator allows for 1000 steps and 99 memories, and both disregard any partitioning command.

Bummer...

Of course I came across that fact tonight as I was typing in the program on my real machine so I could save it to magnetic cards, after I had laboriously entered more than half of the program. Grrrr...



#15 apersson850 OFFLINE  

apersson850

    Dragonstomper

  • 501 posts

Posted Tue Sep 11, 2018 8:23 AM

Ouch. I didn't see your original post about this program until now, or I could have told you that 960 program steps (which is possible) renders zero memories. A pretty useless combination.

The other extreme, 120 registers and no program steps, can't be set on the real machine. You can only go to 160 program steps and 100 memories.

 

The Master Library's matrix program (ML-02) does use close to 960 program steps, though. But that's because programs running from modules run in a different program space, so they can use all data registers and all program steps at the same time.



#16 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 3,245 posts
  • Location:Eagan, MN, USA

Posted Wed Sep 12, 2018 6:17 AM

Air War can probably be optimized quite a bit because it was written in fits and starts over a month period, and it might just be possible to get it to fit on a real machine. When I have some extra time I might take another look at it. 



#17 apersson850 OFFLINE  

apersson850

    Dragonstomper

  • 501 posts

Posted Thu Sep 13, 2018 4:47 PM

If it has some setup or so that's only used when starting up, you may be able to get by if you design it in an overlay fashion. I've done that in the past, when I used the TI-59 extensively. I would typically make the program have 30 or 60 data registers. Thus the program would occupy banks 1, 2 and 3, or bank 1 and 2, on the magnetic cards. By making the last bank swappable, I could read in 240 steps with different code, depending on the task at hand. In that bank, I had the same label in all overlays returning the ID of the overlay. So SBR List would return 1 if the first overlay was loaded, 2 for the second and so on. That made the overlay card read logic able to prompt on the printer for the correct card, but only if it was actually needed. The Math/Utilities module has some assistance for reading cards under program control. A simple version of on-demand paging, if you like.

 

I've also used the data packing in the MU module to store game data arrays in a more efficient way, allowing things like a copy of Hunt the Wumpus from a Rockwell AIM-65 run on the TI-59. Not very fast, but it did run.

 

Looking at the program in the French magazine pictured above, I noticed that the author doesn't seem to know that you don't have to write SBR E to call Label E as a subroutine. Just E is sufficient. SBR E works, but wastes a byte. That was important when you didn't have that many of them...


Edited by apersson850, Thu Sep 13, 2018 4:54 PM.


#18 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 3,245 posts
  • Location:Eagan, MN, USA

Posted Fri Sep 14, 2018 5:30 AM

If it has some setup or so that's only used when starting up, you may be able to get by if you design it in an overlay fashion. I've done that in the past, when I used the TI-59 extensively. I would typically make the program have 30 or 60 data registers. Thus the program would occupy banks 1, 2 and 3, or bank 1 and 2, on the magnetic cards. By making the last bank swappable, I could read in 240 steps with different code, depending on the task at hand. In that bank, I had the same label in all overlays returning the ID of the overlay. So SBR List would return 1 if the first overlay was loaded, 2 for the second and so on. That made the overlay card read logic able to prompt on the printer for the correct card, but only if it was actually needed. The Math/Utilities module has some assistance for reading cards under program control. A simple version of on-demand paging, if you like.

 

Brilliant idea! I was not aware you could control card reading while a program was running... Air War has 43 steps of a one-off initialization, so I could potentially save that. Not sure if it would however be practical to create overlays for the rest of the program as it would require constant reading of magnetic cards. If I can optimize the program a bit, maybe see if I can overload the memory registers to reduce the number needed by half, and make the initialization a one time swapable affair, I just might get the program to fit.

 

Looking at the program in the French magazine pictured above, I noticed that the author doesn't seem to know that you don't have to write SBR E to call Label E as a subroutine. Just E is sufficient. SBR E works, but wastes a byte. That was important when you didn't have that many of them...

 

I did not know that either  :D That's going to save me 6 steps!

 


#19 Vorticon OFFLINE  

Vorticon

    River Patroller

  • Topic Starter
  • 3,245 posts
  • Location:Eagan, MN, USA

Posted Sat Sep 15, 2018 10:17 PM



#20 apersson850 OFFLINE  

apersson850

    Dragonstomper

  • 501 posts

Posted Yesterday, 10:15 PM

Reading overlays from magnetic cards is only really useful if you can make the cards contain routines that perhaps aren't needed to often.

For example, I once made a program which calculated, accumulated, sorted, stored and printed results based on your performance in sports competitions. It could track 20 people, including their names (ten characters). Each competition was stored on one card page.

 

Adding a new competition and storing that was a standard operation, so it was contained in the main program. But printing the results from a year, one competition (one card side) at a time, was a special one, so overlaid.

As results were accumulated, you could watch the printouts and check how the accumulated score changed over time. But that required that all results were available for processing when entering data. Making it possible to insert or delete a competition, and update the rest, was a rare (but extremely convenient!) feature, which hence also was overlaid.

 

But flipping cards all the time while a game is running isn't anything I'd recommend.







Also tagged with one or more of these keywords: TI 58, TI 59, Programming

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users