Content deleted Content added
No edit summary |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1:
{{high-use}}
{{module rating|protected}}
{{Lua|Module:List|Module:Yesno}}
Line 17 ⟶ 18:
'''Examples''' <small>({{purge|refresh|anchor=Number}})</small>
* <
* <
* <
* <
* <
<small>The documentation for this function is partly taken from the [[mw:Extension:Scribunto/Lua reference manual#math.random|Scribunto Lua reference manual]], which is in turn based on the [http://www.lua.org/manual/5.1/index.html Lua 5.1 Reference Manual], available under the [[MIT License]].</small>
Line 40 ⟶ 41:
'''Examples''' <small>({{purge|refresh|anchor=Date}})</small>
* <
* <
* <
* <
* <
* <
* <
== Item ==
Line 58 ⟶ 59:
'''Example''' <small>({{purge|refresh|anchor=Item}})</small>
* <
* <
* <
Setting "same" will make the template select the same number item from each list, even if the things in them are different.
* <syntaxhighlight lang="wikitext">My
{{#invoke:random|item|egg |bean |sausage |bacon |spam |same=yes}}
is
{{#invoke:random|item|quail |pinto |kielbasa |canadian |spammy|same=yes}}
and my
{{#invoke:random|item|blegg |blean |blausage |blacon |blam |same=yes}}
is
{{#invoke:random|item|blail |blinto|blielbasa|blanadian|blammy|same=yes}}</syntaxhighlight>
→ My {{#invoke:random|item|egg |bean |sausage |bacon |spam |same=yes}}
is {{#invoke:random|item|quail |pinto |kielbasa |canadian |spammy|same=yes}} and my
{{#invoke:random|item|blegg |blean |blausage |blacon |blam |same=yes}} is {{#invoke:random|item|blail |blinto|blielbasa|blanadian|blammy|same=yes}}.
== List ==
Line 98 ⟶ 114:
'''Examples''' <small>({{purge|refresh|anchor=List}})</small>
* <
* <
* <
* <
* <
* <
* <
* <
== Text list ==
Line 121 ⟶ 137:
'''Examples''' <small>({{purge|refresh|anchor=Text list}})</small>
* <
* <
* <
* <
* <
* <
== HTML lists ==
Line 141 ⟶ 157:
| <code>bulleted_list</code>
| Bulleted lists
| <
| {{#invoke:random|bulleted_list|egg|sausage|spam}}
|-
| <code>unbulleted_list</code>
| Unbulleted lists
| <
| {{#invoke:random|unbulleted_list|egg|sausage|spam}}
|-
| <code>horizontal_list</code>
| Horizontal bulleted lists
| <
| {{#invoke:random|horizontal_list|egg|sausage|spam}}
|-
| <code>ordered_list</code>
| Ordered lists (numbered lists and alphabetical lists)
| <
| {{#invoke:random|ordered_list|egg|sausage|spam}}
|-
| <code>horizontal_ordered_list</code>
| Horizontal ordered lists
| <
| {{#invoke:random|horizontal_ordered_list|egg|sausage|spam}}
|}
|