TI-83 calc - random numbers
On my TI-83, the randInt(A,B,C) function picks C amount of random numbers between A and B. The only problem is the numbers picked can be the same. Is there any way to make sure they're different?
not quite sure what the calculator supports
you could loop as you would in most languages while the number == the same as the previous number (and if true, generates a new number) and this would be done for all numbers, but again, whether or not a calculator supports, not quite sure
maybe http://www.ti.com/ has some info. about it
you'll need to do a while loop and map all your values to a list (basically a calculator array). Then have the while loop to see if a number is already on the list before adding the current random number. I did something similar when I made minesweeper for my ti92, shouldn't be too difficult
Thanks for your replies,
ti92 went something like this (this is off the top of my head, so no guaruntees it will work):
note: ti92 supports multi character variable names, while the ti83 only supports single characters
:if L1[i]=temp then
note 2: -> indicates a press of the STO button
note 3: the random number syntax is slightly different on the 92
note 4: I don't remember if the syntax for a label is lbl or label, so you'll have to fix that for yourself
Thanks for that - I'll see if I can adapt it.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)