home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / lisp / lispnews / text0043.txt < prev    next >
Encoding:
Text File  |  1985-11-10  |  768 b   |  14 lines

  1. I am having two problems using (random) in Franz lisp.  The first problem is
  2. that I can't find any way to set the seed.  Every time I enter lisp, the
  3. generator is in the same state.  I have had to resort to cfasling a c
  4. procedure that calls srand() (as (random) seems to be defined in c by a call
  5. on rand()).  Is there a way to do this within lisp?  The other problem is
  6. more serious.  The generator seems to generate tight cycles for (at least)
  7. arguments that are small powers of 2.  For example, repeatedly executing
  8. (random 2) yields the sequence 01010101..., and (random 4) yields
  9. 01230123....  These sequences apparently occur no matter to what value I set
  10. the seed.  Does anyone one know what I could be doing wrong, or have a
  11. working random number generator?
  12.  
  13.  
  14.