Jump to content

Module:Random/testcases

From Wikipedia, the free encyclopedia

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}}
  • egg
  • spam
  • bacon
  • beans
  • Lobster Thermidor
  • sausage
  • beans
  • bacon
  • spam
  • Lobster Thermidor
  • egg
  • sausage
{{#invoke:random|bulleted_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|style=color: green}}
  • Lobster Thermidor
  • sausage
  • spam
  • egg
  • beans
  • bacon
  • beans
  • sausage
  • egg
  • bacon
  • Lobster Thermidor
  • spam
{{#invoke:random|bulleted_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|item2_style=color: green|item4_style=color: orange}}
  • bacon
  • spam
  • egg
  • Lobster Thermidor
  • sausage
  • beans
  • spam
  • bacon
  • beans
  • Lobster Thermidor
  • egg
  • sausage
{{#invoke:random|bulleted_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|limit=4}}
  • spam
  • egg
  • Lobster Thermidor
  • sausage
  • Lobster Thermidor
  • bacon
  • spam
  • beans

Unbulleted list

[edit]
Code Main Sandbox
{{#invoke:random|unbulleted_list|egg|spam|beans|sausage|bacon|Lobster Thermidor}}
  • Lobster Thermidor
  • bacon
  • egg
  • spam
  • beans
  • sausage
  • sausage
  • spam
  • Lobster Thermidor
  • egg
  • beans
  • bacon
{{#invoke:random|unbulleted_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|style=color: green}}
  • beans
  • spam
  • Lobster Thermidor
  • bacon
  • sausage
  • egg
  • spam
  • sausage
  • bacon
  • egg
  • Lobster Thermidor
  • beans
{{#invoke:random|unbulleted_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|item2_style=color: green|item4_style=color: orange}}
  • Lobster Thermidor
  • spam
  • beans
  • sausage
  • bacon
  • egg
  • egg
  • sausage
  • Lobster Thermidor
  • bacon
  • spam
  • beans
{{#invoke:random|unbulleted_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|limit=4}}
  • Lobster Thermidor
  • spam
  • egg
  • beans
  • spam
  • beans
  • Lobster Thermidor
  • sausage

Horizontal list

[edit]
Code Main Sandbox
{{#invoke:random|horizontal_list|egg|spam|beans|sausage|bacon|Lobster Thermidor}}
  • spam
  • beans
  • bacon
  • Lobster Thermidor
  • egg
  • sausage
  • beans
  • spam
  • egg
  • bacon
  • Lobster Thermidor
  • sausage
{{#invoke:random|horizontal_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|style=color: green}}
  • Lobster Thermidor
  • bacon
  • egg
  • beans
  • spam
  • sausage
  • beans
  • sausage
  • egg
  • bacon
  • Lobster Thermidor
  • spam
{{#invoke:random|horizontal_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|item2_style=color: green|item4_style=color: orange}}
  • beans
  • bacon
  • sausage
  • egg
  • spam
  • Lobster Thermidor
  • Lobster Thermidor
  • beans
  • sausage
  • spam
  • bacon
  • egg
{{#invoke:random|horizontal_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|limit=4}}
  • sausage
  • egg
  • bacon
  • Lobster Thermidor
  • spam
  • bacon
  • Lobster Thermidor
  • egg

Ordered list

[edit]
Code Main Sandbox
{{#invoke:random|ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor}}
  1. spam
  2. Lobster Thermidor
  3. beans
  4. bacon
  5. sausage
  6. egg
  1. spam
  2. egg
  3. Lobster Thermidor
  4. sausage
  5. beans
  6. bacon
{{#invoke:random|ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|style=color: green}}
  1. egg
  2. spam
  3. beans
  4. sausage
  5. bacon
  6. Lobster Thermidor
  1. beans
  2. egg
  3. spam
  4. bacon
  5. Lobster Thermidor
  6. sausage
{{#invoke:random|ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|item2_style=color: green|item4_style=color: orange}}
  1. sausage
  2. egg
  3. Lobster Thermidor
  4. bacon
  5. beans
  6. spam
  1. sausage
  2. bacon
  3. egg
  4. beans
  5. spam
  6. Lobster Thermidor
{{#invoke:random|ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|list_style_type=lower greek}}
  1. beans
  2. bacon
  3. Lobster Thermidor
  4. egg
  5. spam
  6. sausage
  1. spam
  2. bacon
  3. beans
  4. egg
  5. Lobster Thermidor
  6. sausage
{{#invoke:random|ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|type=I}}
  1. egg
  2. bacon
  3. Lobster Thermidor
  4. beans
  5. spam
  6. sausage
  1. sausage
  2. bacon
  3. beans
  4. Lobster Thermidor
  5. egg
  6. spam
{{#invoke:random|ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|limit=4}}
  1. egg
  2. spam
  3. sausage
  4. beans
  1. egg
  2. sausage
  3. bacon
  4. beans

Horizontal ordered list

[edit]
Code Main Sandbox
{{#invoke:random|horizontal_ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor}}
  1. Lobster Thermidor
  2. sausage
  3. bacon
  4. egg
  5. spam
  6. beans
  1. beans
  2. egg
  3. bacon
  4. spam
  5. Lobster Thermidor
  6. sausage
{{#invoke:random|horizontal_ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|style=color: green}}
  1. Lobster Thermidor
  2. bacon
  3. beans
  4. egg
  5. sausage
  6. spam
  1. spam
  2. egg
  3. bacon
  4. beans
  5. sausage
  6. Lobster Thermidor
{{#invoke:random|horizontal_ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|item2_style=color: green|item4_style=color: orange}}
  1. bacon
  2. egg
  3. beans
  4. spam
  5. Lobster Thermidor
  6. sausage
  1. Lobster Thermidor
  2. bacon
  3. beans
  4. egg
  5. spam
  6. sausage
{{#invoke:random|horizontal_ordered_list|egg|spam|beans|sausage|bacon|Lobster Thermidor|limit=4}}
  1. beans
  2. bacon
  3. egg
  4. sausage
  1. spam
  2. bacon
  3. egg
  4. Lobster Thermidor
[edit]
Code Main Sandbox
{{#invoke:random|link|Aristotle}} Script error: The function "link" does not exist. Script error: The function "link" does not exist.