Ethan Reinsch
Ethan Reinsch

Reputation: 137

How to allow an undefined number of inputs on TI-Nspire CX?

I am in high school, and enjoy creating programs on my TI-Nspire CX calculator. One of the biggest limiting factors in my programming capabilities, are the number of inputs allowed. I only know how to make programs where I allow a set number of inputs. Example: Lets say my program says yes if the data set is a function, or no if the data set is not a function, but you can only enter 4 numbers (x,x,y,y). If you enter "program_name(1,2,3,4)", It would display "Yes". How do I make it so you can enter any amount of numbers, and not just a,b,c,d OR a,b OR a,b,c,d,e,f,g ETC. All help is much appreciated! Thanks!!

Upvotes: 4

Views: 399

Answers (1)

Logan Tischler
Logan Tischler

Reputation: 115

Require the argument to be a list:

Define LibPub prog(vars)=
Prgm
If getType(vars)="LIST" Then
  For var,1,dim(vars)
    "Do something with each item of the list on the next line."
    vars[var]
  EndFor
EndIf
EndPrgm

Upvotes: 1

Related Questions