Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StackOverflow
{
class Program
{
static void Main(string[] args)
{
var list = new List<int>() { 1, 2, 3, 4, 5, 6 };
PrintList(list);
var rnd = new Random();
var shuffled = list.OrderBy(x => rnd.Next()).ToList();
Console.WriteLine();
PrintList(shuffled);
Console.ReadLine();
}
static void PrintList(List<int> list)
{
foreach (var item in list)
Console.Write("{0} ", item);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.