TI NSpire now supports user programs



#2

The latest operating system now supports user-defined programs in addition to user-defined functions. Lack of programming capability was a major deficiency of the original NSpire. It looks like they listened to those who complained.


#3

Thank you for the update Don. I just updated one OS of one TI NSpire CAS calculator, and working on updating the second one!

Looks like TI also updated the manuals for the calculator.

Namir

Edited: 6 Oct 2007, 5:50 p.m.

#4

So, what do the programs look like? Is it a TI-specific language? Something akin to BASIC?

thanks,
bruce

(btw, Don, I'll get back to your email shortly... ;-)


#5

It's a lot like BASIC, or TI-BASIC. Here is our HCC2007 programming contest (rearrange the digits of an input number into numerical order) done on the NSpire:

Define rev_digits(num)=Prgm
:Local i,a,n
:a:={}
:For i,0,iPart(log(num,10))
:a:=augment(a,{mod(intDiv(num,10^(i)),10)})
:EndFor
:SortA a
:n:=0
:For i,1,dim(a)
:n:=n+a[i]*10^(dim(a)-i)
:EndFor
:Disp n
:EndPrgm

I just get each digit of the input number and store it in a list, then sort the list, then convert the list items back into an integer number.


#6

Nice listing Don. Thanks!!

Namir

#7

hi Don,

for comparison, here's the same problem in LUA on the 50g,

function sortNum(n)
a = {tostring(n):byte(1,-1)} -- unpack unto array
table.sort(a)
return tonumber(string.char(unpack(a))) -- pack back and return
end

Edited: 7 Oct 2007, 4:58 p.m.


#8

Very compact code, Hugh, thanks. Is LUA an add-on language to the 50g? I'm not familiar with it, but then I'm not really an RPL guy.


#9

hi don,

"not an RPL" guy", i'm with you there. although i like RPN, ive always found RPL clumsy and almost totally unreadable.

you might like to try your hand at lua on the 50g. get my latest release at:

http://sourceforge.net/projects/hplua

should be hplua-1.0.1.zip. this contains the source code, but all you need is the ARMToolbox and the flua.hp program. once loaded you can try some of my samples like sunset.lua and sudoku.lua

also checkout www.lua.org for the language reference and also the book, "Programming in Lua, Second Edition (Paperback) by Roberto Ierusalimschy", is highly recommended.

good luck!


#10

Thanks, Hugh. I don't have a 50g (there was a door prize of same, but they didn't call my number early enough!). I will check out that book, however, as I am intrigued by how such a small bit of code can do what it does. Very nice.

#11

There is a significant omission from the BASIC instruction set on the NSpire: the Input command. From what I have read, I think this was done on purpose. TI apparently wants the NSpire to be strictly an educational tool, not a "gaming" machine with interactive inputs. Without an Input command, kids who are supposed to be learning the characteristics of a right triangle will not be playing Legends of Doom instead. This is probably the reason that only functions were originally supported.

The only way to provide inputs to your program is to pass them as arguments when you run the program. Hey, that's how FORTRAN worked on the Univac 1108 when I started programming in 1974!


#12

I checked the Reference Manual of the TI nspire and, you are right, there is no Input statement!!!!

Having not gone over the entire Reference Manual yet, can you access individual matrix elements using [row,col] or (row,col)?

Namir


#13

I believe so. I have not done a matrix yet, but you access individual list entries like this: if list a = {1, 2, 3, 4}, then a[3] = 3.


#14

Thanks!!

BTW in the HHC2007 group picture I appear right behind you in the line of vision!!! I hold in my hands my new HP-35s and an early version of the HP-41C that my son's university was willing to retire in my care. Thank you NAU!!!

:-)

Namir

Edited: 7 Oct 2007, 9:20 a.m.

#15

Quote:
I think this was done on purpose. TI apparently wants the NSpire to be strictly an educational tool, not a "gaming" machine with interactive inputs.

And we all know that INPUT serves no purpose other than games.

What a crock. :-(

Quote:
The only way to provide inputs to your program is to pass them as arguments when you run the program. Hey, that's how FORTRAN worked on the Univac 1108 when I started programming in 1974!

I'm 99.99% certain that FORTRAN IV on the 1108 supported input files.


#16

Yeah, that's true. I meant interactive input with a live user. In those days of mainframes only, it was all file processing.


#17

The 1108 supported interactive terminals (e.g., model 33 or 35 Teletypes, Univac DCT 500 or 100, or Uniscope 100 or 300), which could be opened as files. Your site may not have had any, but it wasn't a fundamental limitation of the computer or software.

There was even a "Conversational Fortran V" for it.


#18

Eric, I worked on that Univac 1108 as my first programming job in 1974 at the US Census Bureau in Suitland Maryland (just outside Washington DC). In those days, we punched our FORTRAN progam source code on punch-cards, submitted a batch job overnight to compile the program, and came back the next day to see how many errors we had. Those were the days! Then came the model 33 teletypes, then came the DCT interactive terminals. But the 1108 was never as good at interactive things as it was at batch things. The Census Bureau was a huge file processing organization. All of our programs were designed to read tape files, update the data with various transactions, and write back out onto tape. I forget the tape density, but I think it was 6250 bpi when I left the Bureau around 1983. A file for the whole US might be 100 tapes.

Since our applications did so much IO, the Bureau system guys wrote their own IO system that all us programmers used, called CENIO. It was (supposedly, I never doubted them though) much faster than standard FORTRAN IO.

In those glory days before the personal computer, we never imagined that anyone could actually have and use a computer at home. How times have changed.


#19

This was my experience also. Big fat decks of cards, HOPEFULLY numbered so that the inevitable "whoops!" didn't cause 52-card-pickup (or in some cases, 1052-card-pickup :-), and data was provided inline or in a separate deck. I was lucky if the results came back the next day; it usually took a day or so to get my job run. That was, after all, the value in desk checking your program -- you didn't want to have to resubmit it because you screwed it up somewhere.

I didn't even see "real" input methods until the paper tape machine came along. I could feed my program in again and again after meticulously punching the tape the first time. Back then, the paper tape seemed like MAGIC compared to decks of Fortran cards. ;-)

Ah, how quickly we take technology for granted these days...

thanks,
bruce

Edited: 8 Oct 2007, 6:58 p.m.

#20

My point is that Fortran on the 1108 was certainly capable of both:

  • use of interactive terminals
  • data input from various sources, including interactive terminals

Sure, it was better at batch, and that was how most people used it, but it wasn't the only possibility. The Executive had support for interactive use before 1970, though I'm not sure exactly when it became available. I didn't use an 1100 series machine until the early 1980s, so I'm not as well-versed in its history as the DEC machines.

Quote:
I forget the tape density, but I think it was 6250 bpi when I left the Bureau around 1983.

Sounds about right. The switch from 800 bpi NRZI to 1600 bpi PE occurred in the early to mid 1970s, and 6250 bpi GCR became available in the late 1970s. Some vendors offered 3200 bpi (PE?), but it wasn't a standard and never caught on. (Before 9-track tape there was 7-track at 200, 556, or 800 BPI.)


Possibly Related Threads...
Thread Author Replies Views Last Post
  Does the HP Prime really compiles the user programs? CompSystems 3 855 12-13-2013, 01:55 PM
Last Post: Mike Morrow
  Are HP Prime CAS and TI NSpire CAS the same? hugh steers 14 1,657 10-31-2013, 04:54 PM
Last Post: hugh steers
  Temporary User Mode Key Programs not working in RPN BruceTTT 7 961 10-14-2013, 01:46 PM
Last Post: BruceTTT
  Trading TI Nspire CX CAS for HP Prime Justin Sloan (Honolulu) 2 446 05-09-2013, 04:22 AM
Last Post: Chris Smith
  User Library programs Michae Altmann 5 717 03-05-2013, 06:36 PM
Last Post: Richard Garner
  TI-Nspire on iPad Mic 16 1,384 02-11-2013, 12:16 AM
Last Post: Bruce Bergman
  OT. Linux on a Ti Nspire. Matt Kernal 0 374 11-17-2012, 03:52 PM
Last Post: Matt Kernal
  Seeking new resources for TI NSpire Programming Namir 6 786 07-29-2012, 03:57 AM
Last Post: fhub
  Interesting TI Nspire CAS CX programming features Namir 5 693 04-15-2012, 04:11 PM
Last Post: Namir
  TI CC40 cartridges ... names of programs on them? Gene Wright 3 502 04-08-2012, 10:49 PM
Last Post: Palmer O. Hanson, Jr.

Forum Jump: