home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / amiga / programm / 19076 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  1.8 KB

  1. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!spool.mu.edu!agate!stanford.edu!kronos.arc.nasa.gov!butch!netcomsv!netcomsv!terapin!rreed
  2. From: rreed@terapin.com (Rick Reed)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: AMOS1.34 BUGS
  5. References: <1jgfjkINN5aj@oak1.doc.ic.ac.uk>
  6. Message-ID: <rreed.3e52@terapin.com>
  7. Date: 22 Jan 93 05:08:29 PST
  8. Organization: BBS
  9. Lines: 60
  10.  
  11. In article <1jgfjkINN5aj@oak1.doc.ic.ac.uk>, rpp@doc.ic.ac.uk (Raymond Paul
  12. Price) writes:
  13. >
  14. >Has any of you AMOS1.34 & Compiler 1.34 Users tried using the Randomize and/or
  15. >the enhanced Col command.
  16. >
  17. >Don't work ????
  18. >
  19. >Quite true
  20.  
  21. Hmm... haven't tried the Col command lately...
  22.  
  23. >
  24. >Try
  25. >
  26. >Randomize 2
  27. >?Rnd(100)
  28. >Randomize 2
  29. >?Rnd(100)
  30. >
  31. >Different values ????
  32.  
  33. Hold on!  You're seeding the random number generator with the SAME values!  All
  34. the random number seed does is basically begin a constant chain of psuedo
  35. random numbers.
  36.  
  37. If you did...
  38.  
  39. Randomize 2
  40. ?Rnd(100),Rnd(100),Rnd(100)
  41. Randomize 2
  42. ?Rnd(100),Rnd(100),Rnd(100)
  43.  
  44. You'd get the same sequence of three numbers on both lines!  Why?  Because you
  45. are resetting the pseudo random sequence back to its effectual beginning!! 
  46.  
  47. If, however, you do...
  48.  
  49. Randomize 2
  50. ?Rnd(100),Rnd(100),Rnd(100)
  51. Randomize Timer
  52. ?Rnd(100),Rnd(100),Rnd(100)
  53.  
  54. The two lines of numbers should be different (unless of course Timer equates to
  55. 2 at that moment!).  Running it over and over again would produce the same
  56. numbers for the first line and different numbers for the 2nd!  Why?  'Cause
  57. Timer, when used as a seed, generally (most likely) is different at every
  58. execution, thus giving you a new pseudo sequence.  It's not broken at all!!!
  59.  
  60. >
  61. >Yes there are bugs in these routin. Anyone want to know how to Fix them.
  62. >If there is enough feedback I'll post a little Proggy
  63. >
  64. >rpp@doc.ic.ac.uk
  65. >
  66.  
  67. -Rick
  68.  
  69. rreed@terapin.com
  70.  
  71.