Module:Random/testcases
Appearance
This is the template test cases page for the sandbox of Module:Random. to update the examples. If there are many examples of a complicated template, later ones may break due to limits in MediaWiki; see the HTML comment "NewPP limit report" in the rendered page. You can also use Special:ExpandTemplates to examine the results of template uses. You can test how this page looks in the different skins and parsers with these links: |
Number
[edit]Code | Main | Sandbox |
---|---|---|
{{#invoke:random|number}}
|
0.71815422955814 | 0.2563252645807 |
{{#invoke:random|number|10}}
|
1 | 3 |
{{#invoke:random|number|10|20}}
|
12 | 10 |
{{#invoke:random|number|500000}}
|
100735 | 180601 |
{{#invoke:random|number|-10}}
|
-9 | -7 |
{{#invoke:random|number|20|10}}
|
15 | 16 |
{{#invoke:random|number|-100|-50}}
|
-66 | -83 |
{{#invoke:random|number|6.5}}
|
6 | 1 |
{{#invoke:random|number|-6.5}}
|
-1 | -3 |
{{#invoke:random|number|-16.5|-6.5}}
|
-9.5 | -12.5 |
- Test randomness with the same input
Code | Main | Sandbox |
---|---|---|
{{#invoke:random|number}}
|
0.60240895561986 | 0.79860181584889 |
{{#invoke:random|number}}
|
0.99479467561226 | 0.60561470436194 |
{{#invoke:random|number}}
|
0.48625362593972 | 0.80598987490218 |
{{#invoke:random|number}}
|
0.0021827341998847 | 0.1988643525163 |
{{#invoke:random|number}}
|
0.39505673544251 | 0.59173787645611 |
{{#invoke:random|number}}
|
0.78793073668514 | 0.39875124180631 |
{{#invoke:random|number}}
|
0.59543190644841 | 0.20625241156959 |
{{#invoke:random|number}}
|
0.40244527133296 | 0.013264823245474 |
{{#invoke:random|number}}
|
0.62408532929797 | 0.23490535758198 |
{{#invoke:random|number}}
|
0.48248184774187 | 0.67916251238397 |
{{#invoke:random|number|1000}}
|
425 | 539 |
{{#invoke:random|number|1000}}
|
771 | 493 |
{{#invoke:random|number|1000}}
|
999 | 265 |
{{#invoke:random|number|1000}}
|
352 | 78 |
{{#invoke:random|number|1000}}
|
138 | 984 |
{{#invoke:random|number|1000}}
|
157 | 889 |
{{#invoke:random|number|1000}}
|
591 | 66 |
{{#invoke:random|number|1000}}
|
882 | 165 |
{{#invoke:random|number|1000}}
|
898 | 876 |
{{#invoke:random|number|1000}}
|
50 | 977 |
Same number
[edit]Code | Main | Sandbox |
---|---|---|
{{#invoke:random|number|same=yes}}
|
0.56075048472767 | 0.56075048472767 |
{{#invoke:random|number|same=yes|10}}
|
6 | 6 |
{{#invoke:random|number|same=yes|10|20}}
|
16 | 16 |
{{#invoke:random|number|same=yes|500000}}
|
279833 | 279833 |
{{#invoke:random|number|same=yes|-10}}
|
-5 | -5 |
{{#invoke:random|number|same=yes|20|10}}
|
16 | 16 |
{{#invoke:random|number|same=yes|-100|-50}}
|
-72 | -72 |
{{#invoke:random|number|same=yes|6.5}}
|
4 | 4 |
{{#invoke:random|number|same=yes|-6.5}}
|
-3 | -3 |
{{#invoke:random|number|same=yes|-16.5|-6.5}}
|
-10.5 | -10.5 |
- Test randomness with the same input
Code | Main | Sandbox |
---|---|---|
{{#invoke:random|number|same=yes}}
|
0.56075048472767 | 0.56075048472767 |
{{#invoke:random|number|same=yes}}
|
0.56075048472767 | 0.56075048472767 |
{{#invoke:random|number|same=yes}}
|
0.56075048472767 | 0.56075048472767 |
{{#invoke:random|number|same=yes}}
|
0.56075048472767 | 0.56075048472767 |
{{#invoke:random|number|same=yes}}
|
0.56075048472767 | 0.56075048472767 |
{{#invoke:random|number|same=yes}}
|
0.56075048472767 | 0.56075048472767 |
{{#invoke:random|number|same=yes}}
|
0.56075048472767 | 0.56075048472767 |
{{#invoke:random|number|same=yes}}
|
0.56075048472767 | 0.56075048472767 |
{{#invoke:random|number|same=yes}}
|
0.56075048472767 | 0.56075048472767 |
{{#invoke:random|number|same=yes}}
|
0.56075048472767 | 0.56075048472767 |
{{#invoke:random|number|same=yes|1000}}
|
560 | 560 |
{{#invoke:random|number|same=yes|1000}}
|
560 | 560 |
{{#invoke:random|number|same=yes|1000}}
|
560 | 560 |
{{#invoke:random|number|same=yes|1000}}
|
560 | 560 |
{{#invoke:random|number|same=yes|1000}}
|
560 | 560 |
{{#invoke:random|number|same=yes|1000}}
|
560 | 560 |
{{#invoke:random|number|same=yes|1000}}
|
560 | 560 |
{{#invoke:random|number|same=yes|1000}}
|
560 | 560 |
{{#invoke:random|number|same=yes|1000}}
|
560 | 560 |
{{#invoke:random|number|same=yes|1000}}
|
560 | 560 |
Date
[edit]Code | Main | Sandbox |
---|---|---|
{{#invoke:random|date}}
|
12:03, 19 January 2025 (UTC) | 22:02, 02 November 2025 (UTC) |
{{#invoke:random|date|1 Jan 2000}}
|
07:12, 08 August 1974 (UTC) | 04:48, 22 January 1984 (UTC) |
{{#invoke:random|date|1 Jan 2000|27 July 2176}}
|
20:14, 21 June 2067 (UTC) | 02:10, 06 August 2039 (UTC) |
{{#invoke:random|date|1000|2000|format=Y}}
|
1161 | 1099 |
{{#invoke:random|date|2000|1000|format=Y}}
|
Module:Random error: the start date must not be later than the end date (start date: "2000", end date: "1000"). | Module:Random error: the start date must not be later than the end date (start date: "2000", end date: "1000"). |
{{#invoke:random|date|format=Y/m/d H:i}}
|
2025/04/26 15:25 | 2025/09/03 15:32 |
Item
[edit]Code | Main | Sandbox |
---|---|---|
{{#invoke:random|item|egg|spam|beans|sausage|bacon|Lobster Thermidor}}
|
bacon | beans |
{{#invoke:random|item|egg|spam|beans|sausage|bacon|Lobster Thermidor}}
|
sausage | sausage |
List
[edit]Code | Main | Sandbox |
---|---|---|
{{#invoke:random|list|egg|spam|beans|sausage|bacon|Lobster Thermidor}}
|
eggspambaconbeanssausageLobster Thermidor | eggbeansbaconLobster Thermidorspamsausage |
{{#invoke:random|list|egg|spam|beans|sausage|bacon|Lobster Thermidor}}
|
spamLobster Thermidorsausageeggbaconbeans | Lobster Thermidorbaconspambeanseggsausage |
{{#invoke:random|list|egg|spam|beans|sausage|bacon|Lobster Thermidor|sep=dot}}
|
bacon · spam · egg · Lobster Thermidor · sausage · beans | spam · sausage · Lobster Thermidor · bacon · beans · egg |
{{#invoke:random|list|egg|spam|beans|sausage|bacon|Lobster Thermidor|sep=pipe}}
|
egg | sausage | bacon | Lobster Thermidor | beans | sausage | spam | bacon | egg | beans |
{{#invoke:random|list|egg|spam|beans|sausage|bacon|Lobster Thermidor|sep=comma}}
|
spam, beans, sausage, Lobster Thermidor, egg, bacon | egg, bacon, beans, spam, Lobster Thermidor, sausage |
{{#invoke:random|list|egg|spam|beans|sausage|bacon|Lobster Thermidor|sep=tpt-languages}}
|
bacon⧼tpt-languages-separator⧽spam⧼tpt-languages-separator⧽beans⧼tpt-languages-separator⧽Lobster Thermidor⧼tpt-languages-separator⧽egg⧼tpt-languages-separator⧽sausage | spam⧼tpt-languages-separator⧽egg⧼tpt-languages-separator⧽Lobster Thermidor⧼tpt-languages-separator⧽beans⧼tpt-languages-separator⧽bacon⧼tpt-languages-separator⧽sausage |
{{#invoke:random|list|egg|spam|beans|sausage|bacon|Lobster Thermidor|sep=space}}
|
spam sausage bacon egg Lobster Thermidor beans | sausage egg beans bacon Lobster Thermidor spam |
{{#invoke:random|list|egg|spam|beans|sausage|bacon|Lobster Thermidor|sep=...}}
|
beans...Lobster Thermidor...bacon...sausage...egg...spam | bacon...spam...beans...Lobster Thermidor...sausage...egg |
{{#invoke:random|list|egg|spam|beans|sausage|bacon|Lobster Thermidor|limit=4}}
|
sausageLobster Thermidorspamegg | Lobster Thermidorbeanseggspam |
Text list
[edit]Code | Main | Sandbox |
---|---|---|
{{#invoke:random|text_list|egg|spam|beans|sausage|bacon|Lobster Thermidor}}
|
spam, egg, bacon, Lobster Thermidor, sausage and beans | bacon, beans, spam, egg, Lobster Thermidor and sausage |
{{#invoke:random|text_list|egg|spam|beans|sausage|bacon|Lobster Thermidor}}
|
sausage, Lobster Thermidor, egg, bacon, spam and beans | sausage, bacon, beans, spam, Lobster Thermidor and egg |
{{#invoke:random|text_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|sep=dot}}
|
beans · Lobster Thermidor · bacon · sausage · egg and spam | bacon · Lobster Thermidor · egg · beans · sausage and spam |
{{#invoke:random|text_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|sep=pipe}}
|
bacon | beans | spam | Lobster Thermidor and sausage | beans | bacon | egg | spam and sausage |
{{#invoke:random|text_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|sep=comma}}
|
egg, beans, Lobster Thermidor, spam, sausage and bacon | beans, bacon, sausage, Lobster Thermidor, spam and egg |
{{#invoke:random|text_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|sep=tpt-languages}}
|
Lobster Thermidor⧼tpt-languages-separator⧽spam⧼tpt-languages-separator⧽beans⧼tpt-languages-separator⧽bacon⧼tpt-languages-separator⧽sausage and egg | egg⧼tpt-languages-separator⧽bacon⧼tpt-languages-separator⧽spam⧼tpt-languages-separator⧽Lobster Thermidor⧼tpt-languages-separator⧽sausage and beans |
{{#invoke:random|text_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|sep=space}}
|
sausage spam egg beans Lobster Thermidor and bacon | spam sausage beans bacon Lobster Thermidor and egg |
{{#invoke:random|text_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|sep=...}}
|
Lobster Thermidor...bacon...spam...sausage...egg and beans | beans...Lobster Thermidor...bacon...egg...sausage and spam |
{{#invoke:random|text_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|sep=space|conj=...}}
|
egg spam sausage Lobster Thermidor bacon...beans | beans bacon spam Lobster Thermidor egg...sausage |
{{#invoke:random|text_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|conj=... and }}
|
beans, sausage, egg, Lobster Thermidor, spam... and bacon | egg, beans, bacon, sausage, spam... and Lobster Thermidor |
{{#invoke:random|text_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|limit=4}}
|
spam, beans, sausage and egg | sausage, bacon, Lobster Thermidor and beans |
Bulleted list
[edit]Code | Main | Sandbox |
---|---|---|
{{#invoke:random|bulleted_list|egg|spam|beans|sausage|bacon|Lobster Thermidor}}
|
|
|
{{#invoke:random|bulleted_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|style=color: green}}
|
|
|
{{#invoke:random|bulleted_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|item2_style=color: green|item4_style=color: orange}}
|
|
|
{{#invoke:random|bulleted_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|limit=4}}
|
|
|
Unbulleted list
[edit]Code | Main | Sandbox |
---|---|---|
{{#invoke:random|unbulleted_list|egg|spam|beans|sausage|bacon|Lobster Thermidor}}
|
|
|
{{#invoke:random|unbulleted_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|style=color: green}}
|
|
|
{{#invoke:random|unbulleted_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|item2_style=color: green|item4_style=color: orange}}
|
|
|
{{#invoke:random|unbulleted_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|limit=4}}
|
|
|
Horizontal list
[edit]Code | Main | Sandbox |
---|---|---|
{{#invoke:random|horizontal_list|egg|spam|beans|sausage|bacon|Lobster Thermidor}}
|
|
|
{{#invoke:random|horizontal_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|style=color: green}}
|
|
|
{{#invoke:random|horizontal_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|item2_style=color: green|item4_style=color: orange}}
|
|
|
{{#invoke:random|horizontal_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|limit=4}}
|
|
|
Ordered list
[edit]Code | Main | Sandbox |
---|---|---|
{{#invoke:random|ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor}}
|
|
|
{{#invoke:random|ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|style=color: green}}
|
|
|
{{#invoke:random|ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|item2_style=color: green|item4_style=color: orange}}
|
|
|
{{#invoke:random|ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|list_style_type=lower greek}}
|
|
|
{{#invoke:random|ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|type=I}}
|
|
|
{{#invoke:random|ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|limit=4}}
|
|
|
Horizontal ordered list
[edit]Code | Main | Sandbox |
---|---|---|
{{#invoke:random|horizontal_ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor}}
|
|
|
{{#invoke:random|horizontal_ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|style=color: green}}
|
|
|
{{#invoke:random|horizontal_ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|item2_style=color: green|item4_style=color: orange}}
|
|
|
{{#invoke:random|horizontal_ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|limit=4}}
|
|
|
Random link
[edit]Code | Main | Sandbox |
---|---|---|
{{#invoke:random|link|Aristotle}}
|
Script error: The function "link" does not exist. | Script error: The function "link" does not exist. |