Discussion forum about PANORAMIC language

Mac, Windows & Android application development with PANORAMIC language
 
HomeFAQSearchRegisterMemberlistUsergroupsLog in
Latest topics
» Hello world.
by Mon Jun 19, 2017 1:37 am

» Biomorphes de PICKOVER
by Sun Jun 18, 2017 2:33 am

» In less than 10 lines of code
by Fri Jun 16, 2017 5:03 am

» Effect Dopler
by Fri Jun 16, 2017 3:29 am

» SuperEllipse
by Wed Jun 14, 2017 4:01 am

» Plants
by Wed Jun 14, 2017 3:38 am

» Mira's attractor
by Wed Jun 14, 2017 3:30 am

» Triangle of Sierpinski
by Wed Jun 14, 2017 3:22 am

» Esthétique polaire
by Wed Jun 14, 2017 3:16 am

» Butterfly effect : Lorenz equations
by Wed Jun 14, 2017 3:08 am

» Collision detection
by Tue Jun 13, 2017 5:09 am

» The Bees Laline Paull Epub Books
by Mon Oct 10, 2016 8:58 pm

» PANORAMIC for Mac OSX 10 is available
by Tue Aug 09, 2016 6:08 pm

» ide
by Sat Jul 16, 2016 12:27 am

» Can I change the program icon/logo in my application ?
by Thu Jul 07, 2016 3:32 am

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Share | 
 

 RND()

View previous topic View next topic Go down 
AuthorMessage
Joerg



Number of posts : 19
Registration date : 2009-07-11

PostSubject: RND()   Mon Oct 27, 2014 4:40 pm

Hi again,

is there a way to set a random seed for the RND() function?

Thank you!!
Joerg
Back to top Go down
View user profile
kawe



Number of posts : 18
Registration date : 2010-11-07

PostSubject: Re: RND()   Tue Oct 28, 2014 6:33 pm

At least it's not mentioned in the manual. It should definiteley be added. It is an important function in game programming.

In the meanwhile you may have to use an external number generator.

An example is here:

http://back2basic.phatcode.net/?Issue_%232:Using_DLLs_with_PANORAMIC

Back to top Go down
View user profile
Joerg



Number of posts : 19
Registration date : 2009-07-11

PostSubject: Re: RND()   Tue Oct 28, 2014 8:10 pm

kawe,

it works fine with small values, but with bis numbers like rnd(10000) I mostly get very high values...

Joerg
Back to top Go down
View user profile
kawe



Number of posts : 18
Registration date : 2010-11-07

PostSubject: Re: RND()   Wed Oct 29, 2014 2:07 pm

Joerg wrote:
it works fine with small values, but with bis numbers like rnd(10000) I mostly get very high values...

I'm not sure what you mean? The PANORAMIC function RND(10000)?
'10000' is *not* a 'fixed random index' (and therefore gives reproducible numbers) like in some other BASIC dialects but the upper limit of the result. So, according to the manual RND(10000) is expected to return a 4-digit number in 9 of 10 cases. What's wrong about this?

Or do you mean the DLL-function from the example above?
Back to top Go down
View user profile
Joerg



Number of posts : 19
Registration date : 2009-07-11

PostSubject: Re: RND()   Wed Oct 29, 2014 3:32 pm

Embarassed of course you're right !!

Thanks!!
Joerg
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: RND()   

Back to top Go down
 
RND()
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Discussion forum about PANORAMIC language :: Panoramic for Windows :: Help?-
Jump to: