defzone.net@gmail.comLiên hệ
DZ
DefZone.Net

Kien thuc cong nghe & giai tri

Bai vietDia diemAlbum anhGameCua hang
  1. Home
  2. Wiki
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 (sandbox)

Returns one of N items at random.

Usage

[edit]
  • {{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

[edit]
  • |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 used to be a |range= parameter, but this is no longer needed.

Examples

[edit]

Purge

  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4}} → 1
  • {{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}} → D
  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4|same=y}} → D
  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4|same=y}} → D
  • {{Random item|a|b|c|d|A|B|C|D|1|2|3|4|same=y}} → D

See also

[edit]
  • Template:Random number
The above documentation is transcluded from Template:Random item/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
DZ
DefZone.Net

Noi chia se kien thuc, huong dan va kham pha cong nghe.

Lien ket nhanh

Trang chủBài viếtWikiCửa hàngLiên hệ

Liên hệ

Email: defzone.net@gmail.com
Điện thoại: +84 762 559 696
Địa chỉ: Thiên Hương, Thủy Nguyên, Hải Phòng

Đăng ký nhận tin

Nhận bài viết và cập nhật mới nhất qua email.

© 2025 DefZone.Net. All rights reserved.
PrivacyTermsSitemap