TICALCS.net

Full Version: Output and randint( acting strangely
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a question wondering why outputting a randint( value is outside of the range i specified. Here is my program:

Repeat 1
randInt(1,13) --> X
Output(3,3,X
End

The first time you hit enter, the value with be between 1 and 13. Anytime after that, there is a good chance it will be between 1 and 93. I have noticed that after the command behaves strangely, the second digit is always between 1 and 3, so it seems like number is flipped backwards somehow. Why does this happen, and how can i work around it?

Also another question, using OmniCalc, how do you use the restoremem( function. I can find it in the menu and paste it as real(32, but i don't know what to put in as the next argument. Thanks
You probably shouldn't store the result of randInt(1,13) to X. X is used by the TI-OS for different things, such as graphing, so it's value may be modified without you knowing it. The same goes for Y and theta. Use A or another variable instead.

About your second question, sorry, I don't know much about Omnicalc. This might help though.
for the restoremem thing, type in anything that equals 0 and press enter. the calc will shut off, and all the deleted programs from the last time you turned off your calc will come back
Re your first question: it sounds like you need to clear your screen in the beginning of the loop! That's what is probably causing your errors. Just enter "ClrScr" on a blank line after "Repeat 1."
Actually, it's ClrHome. I think you might be confusing this with a different language Toungue
Reference URL's