Results 1 to 2 of 2

Thread: Pseudo-random number generation

  1. #1
    Lesser Knight
    Join Date
    Dec 2006
    United States

    Default Pseudo-random number generation

    What does Novashell use internally? Lua's math.random() isn't very good (it uses C's rand() function) so if Novashell uses something different internally, perhaps you should expose it.

    Also, misc_util's definition of random/Random can be simplified. It unnecessarily tests whether the arguments are nil, but since functions are first class values you can do:

    Random = math.random
    random = Random

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002


    Thanks, will fix.

    About random:

    Right now I'm using lua's random only. I have a random class based on the mersenne twister algo I should probably plug in at some point, as an object, so people can have multiple custom seeded reproducable (on all platforms hopefully..) number streams.
    Seth A. Robinson
    Robinson Technologies

Similar Threads

  1. Random Idea--FQ?
    By rbanks in forum Dungeon Scroll for PC and iPhone
    Replies: 4
    Last Post: 09-09-2012, 08:26 PM
  2. Random Number Stream Generator
    By Chambers in forum Official ClanLib SDK Forums
    Replies: 6
    Last Post: 06-15-2007, 06:04 AM
  3. A couple of random queries
    By Dan in forum Funeral Quest
    Replies: 7
    Last Post: 06-30-2003, 09:33 AM



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts