Difference between revisions of "Template:RNG"
Jump to navigation
Jump to search
(Making types.) |
(Sorry this stuff is really hard to test, and also is there a difference between CURRENTTIMESTAMP and REVISIONTIMESTAMP if they don't update?) |
||
Line 2: | Line 2: | ||
{{impressive}} | {{impressive}} | ||
Generic random number:<onlyinclude> | Generic random number:<onlyinclude> | ||
− | + | {{#expr:(({{{seed|0}}}+0)^2*731+{{CURRENTTIMESTAMP}})*325 mod {{#if:{{{limit}}}|{{#expr:1+{{{limit|0}}}}}|100}}}} | |
− | |||
− | |||
− | |||
− | }} | ||
</onlyinclude> | </onlyinclude> | ||
<!--More cases coming soon!--> | <!--More cases coming soon!--> | ||
Line 12: | Line 8: | ||
<b>Generated numbers:</b> | <b>Generated numbers:</b> | ||
− | + | Seed 1 limit 30:{{RNG |seed=1|limit=30}}<br /> | |
− | + | Seed 2 limit 30:{{RNG |seed=2|limit=30}}<br /> | |
− | + | Seed 1:{{RNG |seed=1}} | |
</div> | </div> | ||
{{{{BASEPAGENAME}}/doc}} | {{{{BASEPAGENAME}}/doc}} |
Revision as of 02:27, 13 December 2016
This is an Impressive page. It is giving a +3 positive thought to all colonists viewing it. Please consider leaving the page as is, or decorating this page with sculptures. The impressiveness of this page at the moment is 107. |
Generic random number: 0
Generated numbers:
Seed 1 limit 30:
3
Seed 2 limit 30:
7
Seed 1:
0
Description
This template is used to generate random numbers in a relatively short time.
Usage
Type {{RNG}}
on the page to assume a seed of 0 and a limit of 100.
NOTE: Setting a limit value to something greater than 1 000 000 WILL have an effect on the randomness of the result. Use two {{RNG}} templates instead. {{RNG |seed=(number) -->Makes RNGs with different seeds unique to each other. |limit=(number) -->Restricts the RNG to produce only numbers from 1 to limit. }}
Example:
{{RNG |seed=1234 |limit=5000}}
results in: 4796