func_maths_rndseed.rst 755 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .. _func_maths_rndseed:
  2. =======
  3. RndSeed
  4. =======
  5. RndSeed -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. RndSeed()
  10. Get random number generator seed
  11. Use in conjunction with SeedRnd, RndSeed allows you to reproduce sequences of random
  12. numbers.
  13. Parameters
  14. ==========
  15. Return Values
  16. =============
  17. The current random number generator seed
  18. Examples
  19. ========
  20. .. code-block:: blitzmax
  21. ' RndSeed.bmx and SeedRnd.bmx ( one example for both )
  22. ' Get/Set random number seed.
  23. SeedRnd MilliSecs()
  24. seed=RndSeed()
  25. Print "Initial seed="+seed
  26. For k=1 To 10
  27. Print Rand(10)
  28. Next
  29. Print "Restoring seed"
  30. SeedRnd seed
  31. For k=1 To 10
  32. Print Rand(10)
  33. Next
  34. See Also
  35. ========