Template:Random old school/doc: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
(Created page with "'''{{tlx|{{PAGENAME}}}}''' is a randomisation template which comes from a point in the development of wikipedia:template:random number before it depended on <nowiki>{{#tim...")
 
No edit summary
 
Line 1: Line 1:
'''{{tlx|{{PAGENAME}}}}''' is a randomisation template which comes from a point in the development of [[wikipedia:template:random number]] before it depended on <nowiki>{{#time:U}}</nowiki>.  To you, the user, it should still function much like {{tlx|random}}, so those instructions are included below.  
'''{{tlx|{{PAGENAME}}}}''' is a randomisation template which comes from a point in the development of [[wikipedia:template:random number]] before it depended on <nowiki>{{#time:U}}</nowiki>.  To you, the user, it should still function much like {{tlx|random}}, so those instructions are included below.  
Remember, however, that the instructions below are written for {{tlx|random}} and therefore you will have to substitute {{tlx|random}} with {{tlx|random old school}}.  Also, there are currently, as of 23:33, October 21, 2013 (UTC), bugs with {{tlx|random}} that prevent it from randomising properly. Therefore, you may not see the example below change on page load.
''This example'', however, ''should'' randomly display a number between one and 52 for you:
<div style="font-family:anton;font-size:150px;line-height:120%;text-align:center">{{#expr:{{random|52}} + 1}}</div>
<hr>
<hr>
{{Random/doc}}
{{Random/doc}}


<noinclude>[[category:template documentation|{{PAGENAME}}]]</noinclude>
<noinclude>[[category:template documentation|{{PAGENAME}}]]</noinclude>

Latest revision as of 23:33, 21 October 2013

{{Random old school/doc}} is a randomisation template which comes from a point in the development of wikipedia:template:random number before it depended on {{#time:U}}. To you, the user, it should still function much like {{random}}, so those instructions are included below.

Remember, however, that the instructions below are written for {{random}} and therefore you will have to substitute {{random}} with {{random old school}}. Also, there are currently, as of 23:33, October 21, 2013 (UTC), bugs with {{random}} that prevent it from randomising properly. Therefore, you may not see the example below change on page load.

This example, however, should randomly display a number between one and 52 for you:

10

{{random}} generates a random number, at least to the extent that non-mathematicians will be happy with the term "random", through simple markup. The number can be from 1 to whatever number you choose, up to 1000.

Syntax is straightforward:

{{random|1000}} = 165

This number will change every time the page loads.

Though this simple aspect is enough to power any number of functions — such as determining which random, numbered subpage to call on a page, the template does have additional sophistication, detailed at template:random on Wikipedia.

Example of calling forth a page[[edit source]]

If you type the following, you will get a different quote of the week on every page load:

{{qotw/{{#expr:{{random|52}} + 1}}}}

Test it out by reloading this page several times. What you get below will be different on almost every page, though with a sample size of only 52, you're bound to get some repeats. The reason is because there are 53 pages in the following format:

{{qotw/n}}

However, there is no {{tlx|qotw/0}}. Thus by adding 1 to the randomly selected number between 0 and 52, we ensure the choice will be between the numbers 1 and 53.

Fitz Kreiner: You never wanted to join us in the first place.
Anji Kapoor: And I'm sure I complained and had a sour face a lot of the time, but I don't need to tell you it was the most incredible experience. We had a life that most people don't even have the imagination to dream about. I used to think all that stuff was for children, and anyone over the age of ten should have grown out of it. No. What's the expression again? There are some things money definitely can't buy.
PROSE: The Gallifrey Chronicles