Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Siphonic_Sugar on April 29, 2015, 06:36:43 pm

Title: Axe Random Numbers
Post by: Siphonic_Sugar on April 29, 2015, 06:36:43 pm
Again, I have another post that will end up with someone telling me the answer to my problem and that answer will smack me in the face.  But anyway, I'm having trouble with using to rand function to help me create a random number from lets say 30 to 50.  I can't seem to get it to work, so could someone help me with this and give a little explanation because I can't find anything in the pdf thing for axe...
Title: Re: Axe Random Numbers
Post by: Runer112 on April 29, 2015, 07:55:50 pm
Axe really could use a command to generate an integer in a specified range. I think that's been on the to-do list for a long time, but getting it to work in an optimal fashion is a bit tricky. So it remains unimplemented...

Anyways, you can still generate a random integer in a certain range with rand. And you might kick yourself when you hear that, although the necessary information is a bit fractured, you can glean this technique from the Documentation.pdf file:
Title: Re: Axe Random Numbers
Post by: Siphonic_Sugar on April 29, 2015, 08:37:53 pm
Okay, thanks for the help!  ;). By the way, where did you learn all of this stuff?  Years of experience?
Title: Re: Axe Random Numbers
Post by: Runer112 on April 29, 2015, 09:29:00 pm
Yep, years of experience. Looking at my post history, I've been using Axe for just over 5 years now. And when I started, I also asked a bunch of questions. So you're on a good track. :)

By the way, if you want to ask somewhat simple questions like these in the future (which are totally fine; good, even), I'd recommend asking in the Axe Q&A (https://www.omnimaga.org/axe-language/axe-qa/) thread instead of making a topic for each one. Having one thread concentrated with questions and answers is a lot nicer than a bunch of individual topics that die off within a few posts. You can even just browse around the thread as a kind of grab-bag Axe documentation that covers practical information and techniques that may not be documented elsewhere.
Title: Re: Axe Random Numbers
Post by: c4ooo on May 10, 2015, 07:25:55 pm
Well it's sorta steeling someone's thread, but sense it's labeled "axe random numbers" and I need help with "axe random numbers" I guess ils do it anyway  :P
Basicly I need a seeded 16-bit rNdom number genarator. I tried using theLCG method ,but I can't get it to work for some resone :(
If any 1 has some axe or asm code to implement a LCG RNG, I would be grateful if he/she would share it :P