Omnimaga
Calculator Community => TI Calculators => Topic started by: bluepower9 on April 26, 2014, 06:37:04 pm
-
can you make the ti npsire cx cas pick a number if i list out a series of numbers instead of between 2 numbers?
-
Use randSamp(list,1 (or however many items you want)) where list is a list of anything. randSamp should be supported on any Nspire, not just CAS models.
-
Use randSamp(list,1 (or however many items you want)) where list is a list of anything. randSamp should be supported on any Nspire, not just CAS models.
how do you make the list?
-
However you want; you can use a literal, like {1,2,5}, or a function, like seq(2x+1,x,1,10). Any valid list will work.
-
In basic:
list := {1,8,9,2,5,7}
number := randSamp(list,1)
In lua:
list = {1,8,9,2,5,7}
number = list[math.random(1,table.getn(list))]