Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
The Fisher–Yates shuffle array extension method
using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { var randomDigits = Enumerable.Range(0, 10).ToArray().Shuffle(); Console.WriteLine(string.Join(" ", randomDigits)); } } public static class ArrayExtensions { private static Random random = new Random(); public static T[] Shuffle<T>(this T[] array) { int n = array.Length; for (int i = 0; i < n; i++) { int r = i + random.Next(n - i); T t = array[r]; array[r] = array[i]; array[i] = t; } return array; } } }
run
|
edit
|
history
|
help
0
newMultDiv
code exple
Calculator
2.10.4
Lab7
1
Regras Recad grupo
sdfghyjujyhtgrfedcf
How To Get Discord Nitro For Free
Encrypt-Decrypt String