• Home
  • Random
  • Recent changes
  • Special pages
  • Settings
  • About MOASSpedia
  • Disclaimers
MOASSpedia
  • 216.73.216.154
  • Talk
  • Watchlist
  • Contributions
  • Log in

Template:Random item

Template Discussion
  • Language
  • Watch
  • History
  • Edit
    • Page information
    • Permanent link
    • What links here
Template documentation[view] [edit] [history] [purge]
This template should be substituted if you want to generate a random item one time only.
This template uses Lua:
  • Module:Random

Returns one of N items at random.

Contents

  • 1 Usage
  • 2 Parameters
  • 3 Examples
  • 4 See also

Usage

  • {{random item|item1|item2|...|itemN}}
  • All calls to the function using |same=y with the same number of items will return the same item.

Parameters

  • |1=..|2=..|N= --> The items to return.
  • |same=y Set to a truthy value for all calls with this parameter set and the same number of items to return the same item.
  • There use to be a |range= parameter, but this is no longer needed.

Examples

Purge

  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4}} --> d
  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4}} --> B
  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4}} --> c
  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4|same=y}} --> B
  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4|same=y}} --> B
  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4|same=y}} --> B

See also

  • Template:Random number
The above documentation is transcluded from Template:Random item/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://moasspedia.org/w/index.php?title=Template:Random_item&oldid=28253"
Categories:
  • Lua-based templates
  • Mathematical function templates
Last edited on 2 April 2022, at 04:14

MOASSpedia

Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • This page was last edited on 2 April 2022, at 04:14.
  • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • Privacy policy
  • About MOASSpedia
  • Disclaimers
  • Desktop