using static System.Console;
using System.Collections.Generic;
public static class Sorteio {
public static void Main() {
var lista = new List<string>() { "Alaor", "Joseval", "Salustiano", "Gomide", "Castro" };
foreach (var valor in lista) {
string[] array = { "Alaor", "Joseval", "Salustiano", "Gomide", "Castro" };
foreach (var valor in array) {
int[] array2 = { 1, 2, 3, 4, 5 };
foreach (var valor in array2) {
namespace System.Collections.Generic {
public static class IListExt {
static Random r = new Random(DateTime.Now.Millisecond);
public static void Shuffle<T>(this IList<T> list, int lowerItem, int upperItem) {
upperItem = upperItem > list.Count ? list.Count : upperItem;
lowerItem = lowerItem < 0 ? 0 : lowerItem;
for (int i = lowerItem; i < upperItem; i++) {
int j = r.Next(i, upperItem);
public static void Shuffle<T>(this IList<T> list, int upperItem) {
list.Shuffle(0, upperItem);
public static void Shuffle<T>(this IList<T> list) {
list.Shuffle(0, list.Count);