Module:Random/doc

From Soyjak Wiki, The Free Soycyclopedia
Jump to navigationJump to search

This is the documentation page for Module:Random

Number

You will NOT try to use thrembo with this module

{{#invoke:random|number|m|n}}

No Parameters

Selects a random decimal between 0 and 1

{{#invoke:random|number}} -> 0.2241365142279

m

Selects a random integer between 1 and m

{{#invoke:random|number|10}} -> 5

m and n

Selects a random integer between m and n, or n and m depending on which is bigger

{{#invoke:random|number|10|20}} -> 16

{{#invoke:random|number|10|5}} -> 10

Item

This selects a random item declared in the module

{{#invoke:random|item|''[[Image:Minecraft-diamond.png|25px]] '''Gem'''''||''[[Image:Minecraft-Coal.png|25px]] '''Coal'''''}} -> Coal

Consider using <choose> instead, especially if you don't need the random output to be the same across multiple calls in a page and you would prefer not to cache (if the content loads fast enough).

<choose uncached><option>''[[Image:Minecraft-diamond.png|25px]] '''Gem'''''</option><option>''[[Image:Minecraft-Coal.png|25px]] '''Coal'''''</option></choose> -> Gem