This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Technology & Calculator Open Topic subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Calculator Tech Support => Technology & Calculator Open Topic
Author Message
bfr


Member


Joined: 13 Feb 2006
Posts: 108

Posted: 14 Oct 2008 08:28:52 pm    Post subject:

I entered in randInt(1,2,5 in the homescreen and got ERR:OVERFLOW. I then tried using randInt( again with some other inputs, sometimes with the third parameter, sometimes without it, continued to get ERR:OVERFLOW.

At some point, it stopped giving ERR:OVERFLOW and returned somethingE99, I'm guessing (I'm not exactly sure because its value isn't on the screen any more, and I can't really reproduce it). Now, each time I use randInt( with valid arguments, with the result being AEB, A is some random small number that's negative or positive, and B becomes one less than it previously was each time it was each time I use randInt(.

For example, I entered in randInt(1,4 and got -4.27797775E68, and now after entering in randInt(1,3 I get 7.300214229E67. It seems that if I use the same arguments for randInt( as the previous entry and B, the value to the right of E, was positive in the previous entry, then B doesn't decrease. But, if I try using these same arguments a third or greater time, then B decreases.

The last thing I did I entered before I started using randInt( was L1/0, with L1={1,2}, and this never happenned before.

I'll try to post a video of this happening soon.
Back to top
calc84maniac


Elite


Joined: 22 Jan 2007
Posts: 770

Posted: 14 Oct 2008 08:48:44 pm    Post subject:

I've had strange things happen to the random number generator before, and they seem to merely be caused by an ASM program messing with the random number seed (it seemed that Marc the Super Kid Quest was notorious for this). Just store a value to the random number seed and you should be fine.
Back to top
bfr


Member


Joined: 13 Feb 2006
Posts: 108

Posted: 14 Oct 2008 09:26:17 pm    Post subject:

Yeah. Just wondering, (I don't have that much TI-83+ assembly experience) how/why would a program accidentally mess with the random number seed?

Here's the movie, by the way,

EDIT: It lost a lot of quality after being uploaded to DivShare, but whatever


Last edited by Guest on 14 Oct 2008 09:53:09 pm; edited 1 time in total
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 14 Oct 2008 09:58:51 pm    Post subject:

bfr wrote:
Yeah.  Just wondering, (I don't have that much TI-83+ assembly experience) how/why would a program accidentally mess with the random number seed?
[post="127843"]<{POST_SNAPBACK}>[/post]

To draw an image to the screen, a program basically writes the image's data to a certain part of memory, then copies that block of memory to the screen. This is fairly easy to do when the entire image fits on the screen. But what if the image is drawn so low on the screen that part of the image goes "off screen"? If the program isn't careful to guard against this, it will end up writing to the memory immediately after the block of memory that represents the screen. And that memory happens to be where the random number seed is stored.

(If the offense is especially egregious, not only will the random number seed be overwritten, but also the data after it, which is used to back up the characters on the home screen, leaving random garbage text when the program exits)


Last edited by Guest on 14 Oct 2008 10:01:13 pm; edited 1 time in total
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 14 Oct 2008 10:15:05 pm    Post subject:

What both DarkerLine and calc84 said what you should do to fix it; punch this in on the homescreen: 0→rand

DarkerLine just went into an ASM theory about it. I've had/written programs that do what he said. It's not pretty.

But half the time, stuff like this is screwy ASM programs; turning the calc off then on, resetting to defaults, or clearing the RAM (after you've archived everything) usually fixes stuff like this.


Last edited by Guest on 22 Jul 2010 12:37:13 pm; edited 1 time in total
Back to top
bfr


Member


Joined: 13 Feb 2006
Posts: 108

Posted: 15 Oct 2008 05:04:08 pm    Post subject:

Oh, OK, thanks Harrierfalcon, calc84maniac, and DarkerLine.

Last edited by Guest on 15 Oct 2008 05:20:20 pm; edited 1 time in total
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement