Rnd.htm 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>Rnd (start#,end#)</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. start# = Lowest value to generate <br />
  13. end# = Highest value to generate
  14. </td>
  15. </tr>
  16. </table>
  17. <h1>Description</h1>
  18. <table>
  19. <tr>
  20. <td>
  21. This returns either a floating point or integer number of a random value falling between the start and end number. It returns an integer if assiged to an integer variable, and it returns a floating point value if assiged to a floating number variable. The start and end values are inclusive. Be sure to use the SeedRnd command to avoid generating the same random numbers every time the program is run.
  22. </td>
  23. </tr>
  24. </table>
  25. <h1><a href=../2d_examples/Rnd.bb>Example</a></h1>
  26. <table>
  27. <tr>
  28. <td>
  29. y=Rnd(0,10) ; Set y to a random integer between 0 and 10 <br />
  30. y#=Rnd(0,5) ; Set y floating value between 0.000000 and 5.000000
  31. </td>
  32. </tr>
  33. </table>
  34. <br>
  35. <a target=_top href=../index.htm>Index</a><br>
  36. <br>
  37. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=Rnd&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  38. </html>