User:Misza13/Random

This template is an attempt at creating a "random number generator" using WikiSyntax. It generates pseudorandom numbers that change whenever a page containing i

User:Misza13/Random

This template is an attempt at creating a "random number generator" using WikiSyntax. It generates pseudorandom numbers that change whenever a page containing it is edited or every minute (the latter update may require purging the page's cache).


Usage:

  • {{User:Misza13/Random}} produces a random decimal digit: -4
  • {{User:Misza13/Random|N|M}} produces a random number from M to M+N-1, i.e. it rolls a 1dN+M-1, where the M, if ommited, is set to 0. (As you might've guessed by now, N defaults to 10.) Example: {{User:Misza13/Random|90|10}} generates a two-digit number: -44


You can (or rather should!) also specify up to 6 seeds for the generator, which (I think) should be different prime numbers:

  • {{User:Misza13/Random|seed1=7|seed2=47}} gives -2
  • {{User:Misza13/Random|seed2=11|seed5=59|seed6=3}} gives -4


Notes:

  • This template does not render properly when previewing a page. This is because the {{REVISIONID}} variable (one of the sources of "randomness") is not set on preview. It will show up after saving, though.
  • The seed parameters should not be set to high values to avoid integer overflow. You'll know something's wrong when the generator produces negative numbers while it shouldn't.

Have fun! --Misza13 T C


Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.