Difference between revisions of "Template:Pseudorand"

From Twilight Heroes Wiki
Jump to: navigation, search
(New page: <includeonly>{{#expr: {{#time: U}} mod {{{1}}}}}</includeonly><noinclude>This template accepts one parameter X, and will return a different number every time it is used, between 0 and X-1....)
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<includeonly>{{#expr: {{#time: U}} mod {{{1}}}}}</includeonly><noinclude>This template accepts one parameter X, and will return a different number every time it is used, between 0 and X-1. However, the number isn't random, it is based on the current time. Due to a bug with the mod function it doesn't even use the microsecond time '''<nowiki>{{CURRENTTIMESTAMP}}</nowiki>''' but the time in seconds, making it even further away from being random.
+
<includeonly>{{#expr: {{#time: U}} mod {{{1}}}}}</includeonly><noinclude>This template accepts one parameter X, and will return a different number every time it is used, between 0 and X-1. However, the number isn't random, it is based on the current time.
  
For example, '''<nowiki>{{pseudorand|13}}</nowiki>''' returns {{#expr: {{#time: U}} mod 13}}.[[Category:Templates]]</noinclude>
+
For example, '''<nowiki>{{pseudorand|13}}</nowiki>''' returns {{#expr: {{#time: U}} mod 13}}.[[Category:Utility Templates|{{PAGENAME}}]]</noinclude>

Latest revision as of 00:58, 22 February 2010

This template accepts one parameter X, and will return a different number every time it is used, between 0 and X-1. However, the number isn't random, it is based on the current time.

For example, {{pseudorand|13}} returns 9.