Template:Rand

From Traveller Wiki - Science-Fiction Adventure in the Far future
Jump to navigation Jump to search

This template generates a pseudo-random integer between 0 and count-1.

Usage:
  • {{Random number|count|seed|prime}}
  • All parameters are optional and have default values. They must be integers.
  • The default count is 100 (so by default, this template generates values between 0 and 99) and must be non-zero.
  • The default seed is {{#time:z}} (currently 108, i.e. the current day number in the year, at the time this page was last saved or purged from the cache) and can be set to any other integer value (used to generate distinct values on the same page).
  • The default prime is 67 and should be a prime number above 17 (used to generate distinct values on the same page).