func_maths_seedrnd.rst 635 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. .. _func_maths_seedrnd:
  2. =======
  3. SeedRnd
  4. =======
  5. SeedRnd -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. SeedRnd( seed )
  10. Set random number generator seed
  11. Parameters
  12. ==========
  13. Return Values
  14. =============
  15. Nothing.
  16. Examples
  17. ========
  18. .. code-block:: blitzmax
  19. ' RndSeed.bmx and SeedRnd.bmx ( one example for both )
  20. ' Get/Set random number seed.
  21. SeedRnd MilliSecs()
  22. seed=RndSeed()
  23. Print "Initial seed="+seed
  24. For k=1 To 10
  25. Print Rand(10)
  26. Next
  27. Print "Restoring seed"
  28. SeedRnd seed
  29. For k=1 To 10
  30. Print Rand(10)
  31. Next
  32. See Also
  33. ========