Re: TIB: Infinant requesting on ti-89 basic


[Prev][Next][Index][Thread]

Re: TIB: Infinant requesting on ti-89 basic




In a message dated 2/18/99 3:09:03 PM Central Standard Time,
cassetti@yahoo.com writes:

> hi, i have allways wanted to know
>  how to ask someone how many things they want to store, and it stores
>  things to the specified # of times
>  EX:
>  i tell a program that i want to add 10 phone #'s, the program askes me
>  to enter 10 phone #'s, and if i told it 50 phone numbers, it would
>  prompt me for 50 phone #'s ( or some other thing! )
>  
>  What are the commands that i would use??
>  I need to know for a program that will be a study guide. This program
>  (for the 89) will ask for a question and the answer to the questions
>  and then it will randomly ask you the questions you answered ( to help
>  you study)

Prompt the user to enter the number of items, store this number to x, and then
create a matrix NewMat(2,x)->variable and then make a For loop from i=one to
i=x, and inside the loop, (assuming you'll be using a matrix or data variable)
just read in the question and store it to variable[1,i] and then the answer
and store this to variable[2,x].  To randomize, use another for loop from i=1
to i=x, store a random integer between 1 and x to y, and then swap
variable[1,i] with variable[1,y] and swap variable[2,i] with variable[2,y].
That's not the fastest way to randomize, but it's the easiest to understand
and has the shortest code.  If you want a faster, high tech algorithm just ask
and I'll think something up for you.
PJC II